mirror of
https://github.com/anyproto/anytype-ts.git
synced 2025-06-07 21:47:02 +09:00
src/ts/app.tsx
This commit is contained in:
parent
d6555dac7d
commit
cd42b5e23f
3 changed files with 15 additions and 7 deletions
|
@ -566,7 +566,7 @@ class App extends React.Component<object, State> {
|
|||
|
||||
keyboard.disableContextOpen(true);
|
||||
|
||||
const { focused, range } = focus.state;
|
||||
const { focused } = focus.state;
|
||||
const win = $(window);
|
||||
const options: any = dictionarySuggestions.map(it => ({ id: it, name: it }));
|
||||
const element = $(document.elementFromPoint(x, y));
|
||||
|
@ -599,7 +599,7 @@ class App extends React.Component<object, State> {
|
|||
|
||||
// Find the first occurrence of the misspelled word in the value
|
||||
const wordIndex = value.indexOf(misspelledWord);
|
||||
if (wordIndex !== -1) {
|
||||
if (wordIndex >= 0) {
|
||||
U.Data.blockInsertText(
|
||||
rootId,
|
||||
focused,
|
||||
|
@ -607,9 +607,10 @@ class App extends React.Component<object, State> {
|
|||
wordIndex,
|
||||
wordIndex + misspelledWord.length
|
||||
);
|
||||
|
||||
focus.set(focused, { from: wordIndex, to: wordIndex + item.id.length });
|
||||
focus.apply();
|
||||
}
|
||||
};
|
||||
} else
|
||||
if (isInput || isTextarea || isEditable) {
|
||||
let value = '';
|
||||
|
|
|
@ -13,16 +13,23 @@ const PageAuthSelect = forwardRef<{}, I.PageComponent>((props, ref) => {
|
|||
};
|
||||
|
||||
const onRegister = () => {
|
||||
const { account } = S.Auth;
|
||||
const cb = () => U.Router.go('/auth/onboard', {});
|
||||
|
||||
if (account) {
|
||||
cb();
|
||||
return;
|
||||
};
|
||||
|
||||
registerRef.current.setLoading(true);
|
||||
|
||||
U.Data.accountCreate(error => {
|
||||
registerRef.current.setLoading(false);
|
||||
setError(error);
|
||||
}, () => Animation.from(() => U.Router.go('/auth/onboard', {})));
|
||||
}, () => Animation.from(cb));
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
S.Auth.clearAll();
|
||||
S.Common.getRef('mainAnimation')?.create();
|
||||
|
||||
Animation.to(() => {
|
||||
|
|
|
@ -37,7 +37,7 @@ const Vault = observer(forwardRef<VaultRefProps>((props, ref) => {
|
|||
const itemsWithCounterIds = itemsWithCounter.map(it => it.id);
|
||||
const itemsWithoutCounter = items.filter(it => !itemsWithCounterIds.includes(it.id));
|
||||
const itemAdd = { id: 'add', name: translate('commonNewSpace'), isButton: true };
|
||||
const itemSettings = { ...profile, id: 'settings', name: translate('commonAppSettings'), layout: I.ObjectLayout.Human };
|
||||
const itemSettings = { ...profile, id: 'settings', tooltip: translate('commonAppSettings'), layout: I.ObjectLayout.Human };
|
||||
const canCreate = U.Space.canCreateSpace();
|
||||
|
||||
const cn = [ 'vault' ];
|
||||
|
@ -335,7 +335,7 @@ const Vault = observer(forwardRef<VaultRefProps>((props, ref) => {
|
|||
const element = node.find(`#item-${item.id}`);
|
||||
|
||||
Preview.tooltipShow({
|
||||
text: U.Common.htmlSpecialChars(item.name),
|
||||
text: U.Common.htmlSpecialChars(item.tooltip || item.name),
|
||||
element,
|
||||
className: 'fromVault',
|
||||
typeX: I.MenuDirection.Left,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue