editedCheck() {
        // The check succeeded, just start the heartbeat
        if(!this.model || !this.model.viewedBy || !this.model.viewedOn || this.model.viewedBy === HashBrown.Context.user.id || new Date() - this.model.viewedOn > HEARTBEAT_INTERVAL + HEARTBEAT_TIMEOUT) {
            this.onHeartbeat();
        
        // The check failed, ask the user if they want to proceed
        } else {
            let modal = UI.confirm('Resource busy', `"${this.state.title}" is currently being edited by someone else. Do you still want to proceed?`);

            modal.on('yes', () => {
                this.onHeartbeat();
            });

            modal.on('no', () => {
                location.hash = '/' + this.category + '/';
            });
        }
    }
/**
     * Checks whether this resource is currently being edited by someone else, and displays a warning if it is
     */
Checks whether this resource is currently being edited by someone else, and displays a warning if it is
Checks whether this resource is currently being edited by someone else and displays a warning if it is
editedCheck() {
        if(!this.model || !this.model.viewedBy || !this.model.viewedOn || this.model.viewedBy === HashBrown.Context.user.id || new Date() - this.model.viewedOn > HEARTBEAT_INTERVAL + HEARTBEAT_TIMEOUT) {
            this.onHeartbeat();
        } else {
            let modal = UI.confirm('Resource busy', `"${this.state.title}" is currently being edited by someone else. Do you still want to proceed?`);
            modal.on('yes', () => {
                this.onHeartbeat();
            });
            modal.on('no', () => {
                location.hash = '/' + this.category + '/';
            });
        }
    }
editedCheck ( ) { if ( ! this . model || ! this . model . viewedBy || ! this . model . viewedOn || this . model . viewedBy === HashBrown . Context . user . id || new Date ( ) - this . model . viewedOn > HEARTBEAT_INTERVAL + HEARTBEAT_TIMEOUT ) { this . onHeartbeat ( ) ; } else { let modal = UI . confirm ( 'Resource busy' , ` ${ this . state . title } ` ) ; modal . on ( 'yes' , ( ) => { this . onHeartbeat ( ) ; } ) ; modal . on ( 'no' , ( ) => { location . hash = '/' + this . category + '/' ; } ) ; } }
Checks whether this resource is currently being edited by someone else, and displays a warning if it is
Checks whether this resource is currently being edited by someone else and displays a warning if it is
// The check succeeded, just start the heartbeat // The check failed, ask the user if they want to proceed