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