mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-07-09 20:09:36 +02:00
mobile: show loading in switch item when disabling inbox api
This commit is contained in:
committed by
Abdullah Atta
parent
91a56058bb
commit
d2ca64d7c9
@@ -751,28 +751,35 @@ export const settingsGroups: SettingSection[] = [
|
||||
getter: (current) => current,
|
||||
modifer: async (current) => {
|
||||
if (current) {
|
||||
presentDialog({
|
||||
title: strings.disableInboxAPI(),
|
||||
paragraph: strings.disableInboxAPIDesc(),
|
||||
positiveText: strings.disable(),
|
||||
positivePress: async () => {
|
||||
try {
|
||||
await db.inboxItemsHistory.deleteFailed();
|
||||
await db.user.discardInboxKeys();
|
||||
useSettingStore.setState({
|
||||
inboxEnabled: false
|
||||
});
|
||||
return true;
|
||||
} catch (e) {
|
||||
ToastManager.show({
|
||||
message: (e as Error).message,
|
||||
context: "local"
|
||||
});
|
||||
DatabaseLogger.error(e);
|
||||
return false;
|
||||
return new Promise((resolve) => {
|
||||
presentDialog({
|
||||
title: strings.disableInboxAPI(),
|
||||
paragraph: strings.disableInboxAPIDesc(),
|
||||
positiveText: strings.disable(),
|
||||
onClose: () => {
|
||||
resolve();
|
||||
},
|
||||
positivePress: async () => {
|
||||
try {
|
||||
await db.inboxItemsHistory.deleteFailed();
|
||||
await db.user.discardInboxKeys();
|
||||
useSettingStore.setState({
|
||||
inboxEnabled: false
|
||||
});
|
||||
resolve();
|
||||
return true;
|
||||
} catch (e) {
|
||||
ToastManager.show({
|
||||
message: (e as Error).message,
|
||||
context: "local"
|
||||
});
|
||||
DatabaseLogger.error(e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user