Skip to content

Commit 17c1e7e

Browse files
committed
MOBILE-1701 wiki: Unregister renew lock interval
1 parent ae2839b commit 17c1e7e

File tree

1 file changed

+4
-2
lines changed
  • www/addons/mod/wiki/controllers

1 file changed

+4
-2
lines changed

www/addons/mod/wiki/controllers/edit.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,8 @@ angular.module('mm.addons.mod_wiki')
3737
groupId,
3838
userId,
3939
rteEnabled,
40-
subwikiFiles;
40+
subwikiFiles,
41+
renewLockInterval;
4142

4243
$scope.saveAndGoParams = false; // See $ionicView.afterLeave.
4344
$scope.component = mmaModWikiComponent;
@@ -195,7 +196,7 @@ angular.module('mm.addons.mod_wiki')
195196
version = editContents.version;
196197

197198
if (canEdit) {
198-
$interval(function() {
199+
renewLockInterval = $interval(function() {
199200
renewLock();
200201
}, mmaModWikiRenewLockTimeout * 1000);
201202
}
@@ -283,5 +284,6 @@ angular.module('mm.addons.mod_wiki')
283284
// Restore original back functions.
284285
unregisterHardwareBack();
285286
$rootScope.$ionicGoBack = originalBackFunction;
287+
$interval.cancel(renewLockInterval);
286288
});
287289
});

0 commit comments

Comments
 (0)