Fix strict mode editor blur bug

This commit is contained in:
Gregory Schier
2023-03-30 10:38:33 -07:00
parent 3a38127fb4
commit 5f0876a136
9 changed files with 56 additions and 29 deletions

View File

@@ -5,8 +5,9 @@ const useGlobalState = createGlobalState<Record<string, string>>({});
export function useRequestUpdateKey(requestId: string | null) {
const [keys, setKeys] = useGlobalState();
const key = keys[requestId ?? 'n/a'];
return {
updateKey: `${requestId}::${keys[requestId ?? 'n/a']}`,
updateKey: `${requestId}::${key ?? 'default'}`,
wasUpdatedExternally: (changedRequestId: string) => {
setKeys((m) => ({ ...m, [changedRequestId]: generateId() }));
},

View File

@@ -62,7 +62,10 @@ export function useTauriListeners() {
: null;
if (queryKey === null) {
throw new Error('Unrecognized updated model ' + payload.model);
if (payload.model) {
console.log('Unrecognized updated model:', payload);
}
return;
}
const skipSync = payload.model === 'key_value' && payload.namespace === NAMESPACE_NO_SYNC;