1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-07-16 00:14:34 +02:00

Mobile: Allow enabling and disabling feature flags

This commit is contained in:
Laurent Cozic
2021-06-19 17:32:36 +01:00
parent fc132216cb
commit 5b368e39ca
10 changed files with 189 additions and 130 deletions

View File

@ -3,7 +3,7 @@ export default class NavService {
public static dispatch: Function = () => {};
private static handlers_: Function[] = [];
static async go(routeName: string) {
public static async go(routeName: string) {
if (this.handlers_.length) {
const r = await this.handlers_[this.handlers_.length - 1]();
if (r) return r;
@ -15,7 +15,7 @@ export default class NavService {
});
}
static addHandler(handler: Function) {
public static addHandler(handler: Function) {
for (let i = this.handlers_.length - 1; i >= 0; i--) {
const h = this.handlers_[i];
if (h === handler) return;
@ -24,7 +24,7 @@ export default class NavService {
this.handlers_.push(handler);
}
static removeHandler(hanlder: Function) {
public static removeHandler(hanlder: Function) {
for (let i = this.handlers_.length - 1; i >= 0; i--) {
const h = this.handlers_[i];
if (h === hanlder) this.handlers_.splice(i, 1);