Fix logout & delete folder buttons on iOS
This commit is contained in:
parent
3758f936d0
commit
f7b54d171a
@ -8,6 +8,7 @@ import { ripple } from "../../ripple";
|
|||||||
import { SliderTab } from "../../slider";
|
import { SliderTab } from "../../slider";
|
||||||
import { toast } from "../../toast";
|
import { toast } from "../../toast";
|
||||||
import appMessagesManager from "../../../lib/appManagers/appMessagesManager";
|
import appMessagesManager from "../../../lib/appManagers/appMessagesManager";
|
||||||
|
import { CLICK_EVENT_NAME } from "../../../helpers/dom";
|
||||||
|
|
||||||
const MAX_FOLDER_NAME_LENGTH = 12;
|
const MAX_FOLDER_NAME_LENGTH = 12;
|
||||||
|
|
||||||
@ -71,7 +72,7 @@ export default class AppEditFolderTab implements SliderTab {
|
|||||||
this.animation = player;
|
this.animation = player;
|
||||||
});
|
});
|
||||||
|
|
||||||
this.deleteFolderBtn.addEventListener('click', () => {
|
this.deleteFolderBtn.addEventListener(CLICK_EVENT_NAME, () => {
|
||||||
this.deleteFolderBtn.setAttribute('disabled', 'true');
|
this.deleteFolderBtn.setAttribute('disabled', 'true');
|
||||||
appMessagesManager.filtersStorage.updateDialogFilter(this.filter, true).then(bool => {
|
appMessagesManager.filtersStorage.updateDialogFilter(this.filter, true).then(bool => {
|
||||||
if(bool) {
|
if(bool) {
|
||||||
|
@ -5,6 +5,7 @@ import { parseMenuButtonsTo } from "../../misc";
|
|||||||
import apiManager from "../../../lib/mtproto/mtprotoworker";
|
import apiManager from "../../../lib/mtproto/mtprotoworker";
|
||||||
import appSidebarLeft, { AppSidebarLeft } from "..";
|
import appSidebarLeft, { AppSidebarLeft } from "..";
|
||||||
import appUsersManager from "../../../lib/appManagers/appUsersManager";
|
import appUsersManager from "../../../lib/appManagers/appUsersManager";
|
||||||
|
import { CLICK_EVENT_NAME } from "../../../helpers/dom";
|
||||||
|
|
||||||
export default class AppSettingsTab implements SliderTab {
|
export default class AppSettingsTab implements SliderTab {
|
||||||
private container = document.querySelector('.settings-container') as HTMLDivElement;
|
private container = document.querySelector('.settings-container') as HTMLDivElement;
|
||||||
@ -30,7 +31,7 @@ export default class AppSettingsTab implements SliderTab {
|
|||||||
this.fillElements();
|
this.fillElements();
|
||||||
}); */
|
}); */
|
||||||
|
|
||||||
this.logOutBtn.addEventListener('click', (e) => {
|
this.logOutBtn.addEventListener(CLICK_EVENT_NAME, (e) => {
|
||||||
apiManager.logOut();
|
apiManager.logOut();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -132,17 +132,25 @@ export class ApiManager {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return Promise.all(logoutPromises).then(() => {
|
const clear = () => {
|
||||||
}, (error) => {
|
//console.error('apiManager: logOut clear');
|
||||||
error.handled = true;
|
|
||||||
}).finally(() => {
|
|
||||||
this.baseDcId = 0;
|
this.baseDcId = 0;
|
||||||
//this.telegramMeNotify(false);
|
//this.telegramMeNotify(false);
|
||||||
const promise = AppStorage.clear();
|
const promise = AppStorage.clear();
|
||||||
promise.finally(() => {
|
promise.finally(() => {
|
||||||
self.postMessage({type: 'reload'});
|
self.postMessage({type: 'reload'});
|
||||||
});
|
});
|
||||||
})/* .then(() => {
|
};
|
||||||
|
|
||||||
|
setTimeout(clear, 1e3);
|
||||||
|
|
||||||
|
//return;
|
||||||
|
|
||||||
|
return Promise.all(logoutPromises).then(() => {
|
||||||
|
}, (error) => {
|
||||||
|
error.handled = true;
|
||||||
|
}).finally(clear)/* .then(() => {
|
||||||
location.pathname = '/';
|
location.pathname = '/';
|
||||||
}) */;
|
}) */;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user