Fix Sieve Circular dependency

This commit is contained in:
the-djmaze 2022-03-11 13:01:46 +01:00
parent ea25d9bce4
commit 9bae77bfa1
2 changed files with 34 additions and 36 deletions

View file

@ -1,5 +1,3 @@
import { SieveScriptModel } from 'Sieve/Model/Script';
export const
// import { i18n } from 'Common/Translator';
i18n = rl.i18n,
@ -58,32 +56,4 @@ export const
setError = text => {
serverError(true);
serverErrorDesc(text);
},
updateList = () => {
if (!loading()) {
loading(true);
serverError(false);
Remote.request('Filters', (iError, data) => {
loading(false);
scripts([]);
if (iError) {
capa([]);
setError(getNotification(iError));
} else {
capa(data.Result.Capa);
/*
scripts(
data.Result.Scripts.map(aItem => SieveScriptModel.reviveFromJson(aItem)).filter(v => v)
);
*/
forEachObjectValue(data.Result.Scripts, value => {
value = SieveScriptModel.reviveFromJson(value);
value && scripts.push(value)
});
}
});
}
};