mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-01 05:29:20 +03:00
ko cleaning up
This commit is contained in:
parent
fcac46f60e
commit
d8321a522e
25 changed files with 396 additions and 131 deletions
|
|
@ -25,6 +25,7 @@
|
|||
FiltersAppSetting.prototype.deleteFilter = function (oFilter)
|
||||
{
|
||||
this.filters.remove(oFilter);
|
||||
Utils.delegateRunOnDestroy(oFilter);
|
||||
};
|
||||
|
||||
FiltersAppSetting.prototype.addFilter = function ()
|
||||
|
|
|
|||
|
|
@ -4,8 +4,11 @@
|
|||
'use strict';
|
||||
|
||||
var
|
||||
_ = require('_'),
|
||||
ko = require('ko'),
|
||||
|
||||
Utils = require('Common/Utils'),
|
||||
|
||||
kn = require('Knoin/Knoin'),
|
||||
|
||||
Data = require('Storage/App/Data')
|
||||
|
|
@ -64,14 +67,20 @@
|
|||
|
||||
if (oOpenPgpKeyToRemove && Data.openpgpKeyring)
|
||||
{
|
||||
this.openpgpkeys.remove(function (oOpenPgpKey) {
|
||||
var oFindedItem = _.find(this.openpgpkeys(), function (oOpenPgpKey) {
|
||||
return oOpenPgpKeyToRemove === oOpenPgpKey;
|
||||
});
|
||||
|
||||
Data.openpgpKeyring[oOpenPgpKeyToRemove.isPrivate ? 'privateKeys' : 'publicKeys']
|
||||
.removeForId(oOpenPgpKeyToRemove.guid);
|
||||
if (oFindedItem)
|
||||
{
|
||||
this.openpgpkeys.remove(oFindedItem);
|
||||
Utils.delegateRunOnDestroy(oFindedItem);
|
||||
|
||||
Data.openpgpKeyring.store();
|
||||
Data.openpgpKeyring[oFindedItem.isPrivate ? 'privateKeys' : 'publicKeys']
|
||||
.removeForId(oFindedItem.guid);
|
||||
|
||||
Data.openpgpKeyring.store();
|
||||
}
|
||||
|
||||
require('App/App').reloadOpenPgpKeys();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue