1
0
mirror of https://github.com/flarum/core.git synced 2025-07-17 06:41:21 +02:00

Remove usage of finally

See flarum/core@60d78ce
This commit is contained in:
Toby Zerner
2016-01-19 18:58:15 +10:30
parent 88a06b1843
commit c52d32fbd0
3 changed files with 6 additions and 4 deletions

View File

@@ -322,7 +322,7 @@ System.register('flarum/flags/components/FlagList', ['flarum/Component', 'flarum
app.cache.flags = flags.sort(function (a, b) { app.cache.flags = flags.sort(function (a, b) {
return b.time() - a.time(); return b.time() - a.time();
}); });
})['finally'](function () { })['catch'](function () {}).then(function () {
_this.loading = false; _this.loading = false;
m.redraw(); m.redraw();
}); });
@@ -498,7 +498,7 @@ System.register('flarum/flags/components/FlagPostModal', ['flarum/components/Mod
} }
}).then(function () { }).then(function () {
return _this.success = true; return _this.success = true;
})['finally'](this.loaded.bind(this)); })['catch'](function () {}).then(this.loaded.bind(this));
} }
}]); }]);
return FlagPostModal; return FlagPostModal;

View File

@@ -75,7 +75,8 @@ export default class FlagList extends Component {
app.session.user.pushAttributes({newFlagsCount: 0}); app.session.user.pushAttributes({newFlagsCount: 0});
app.cache.flags = flags.sort((a, b) => b.time() - a.time()); app.cache.flags = flags.sort((a, b) => b.time() - a.time());
}) })
.finally(() => { .catch(() => {})
.then(() => {
this.loading = false; this.loading = false;
m.redraw(); m.redraw();
}); });

View File

@@ -100,6 +100,7 @@ export default class FlagPostModal extends Modal {
} }
}) })
.then(() => this.success = true) .then(() => this.success = true)
.finally(this.loaded.bind(this)); .catch(() => {})
.then(this.loaded.bind(this));
} }
} }