mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Code refactoring
This commit is contained in:
parent
60bac7192f
commit
90d95d3ca4
28 changed files with 977 additions and 924 deletions
|
|
@ -22,10 +22,7 @@ class CookieDriver
|
|||
const storageValue = $.cookie(CLIENT_SIDE_STORAGE_INDEX_NAME);
|
||||
storageResult = null === storageValue ? null : JSON.parse(storageValue);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
catch (e) {/* eslint-disable-line no-empty */}
|
||||
|
||||
(storageResult || (storageResult = {}))[key] = data;
|
||||
|
||||
|
|
@ -37,10 +34,7 @@ class CookieDriver
|
|||
|
||||
result = true;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
catch (e) {/* eslint-disable-line no-empty */}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -62,10 +56,7 @@ class CookieDriver
|
|||
|
||||
result = (storageResult && !isUnd(storageResult[key])) ? storageResult[key] : null;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
catch (e) {/* eslint-disable-line no-empty */}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,10 +22,7 @@ class LocalStorageDriver
|
|||
const storageValue = window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] || null;
|
||||
storageResult = null === storageValue ? null : JSON.parse(storageValue);
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
catch (e) {/* eslint-disable-line no-empty */}
|
||||
|
||||
(storageResult || (storageResult = {}))[key] = data;
|
||||
|
||||
|
|
@ -34,10 +31,7 @@ class LocalStorageDriver
|
|||
window.localStorage[CLIENT_SIDE_STORAGE_INDEX_NAME] = JSON.stringify(storageResult);
|
||||
result = true;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
catch (e) {/* eslint-disable-line no-empty */}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
@ -59,10 +53,7 @@ class LocalStorageDriver
|
|||
|
||||
result = (storageResult && !isUnd(storageResult[key])) ? storageResult[key] : null;
|
||||
}
|
||||
catch (e)
|
||||
{
|
||||
// eslint-disable-line no-empty
|
||||
}
|
||||
catch (e) {/* eslint-disable-line no-empty */}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue