mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-05 07:27:04 +03:00
Change ()=>{} into ()=>0
This commit is contained in:
parent
2d87b52c07
commit
d536b5eeee
10 changed files with 21 additions and 23 deletions
|
|
@ -44,7 +44,7 @@ export class AbstractScreen {
|
|||
const routes = this.routes();
|
||||
if (arrayLength(routes)) {
|
||||
let route = new Crossroads(),
|
||||
fMatcher = (this.onRoute || (()=>{})).bind(this);
|
||||
fMatcher = (this.onRoute || (()=>0)).bind(this);
|
||||
|
||||
routes.forEach(item => item && route && (route.addRoute(item[0], fMatcher).rules = item[1]));
|
||||
|
||||
|
|
|
|||
|
|
@ -27,15 +27,13 @@ export const ViewType = {
|
|||
* @returns {Function}
|
||||
*/
|
||||
export function createCommand(fExecute, fCanExecute = true) {
|
||||
let fResult = null;
|
||||
|
||||
fResult = fExecute
|
||||
let fResult = fExecute
|
||||
? (...args) => {
|
||||
if (fResult && fResult.canExecute && fResult.canExecute()) {
|
||||
fExecute.apply(null, args);
|
||||
}
|
||||
return false;
|
||||
} : ()=>{};
|
||||
} : ()=>0;
|
||||
fResult.enabled = ko.observable(true);
|
||||
fResult.isCommand = true;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue