mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-17 01:42:19 +00:00
Return the promise.
This commit is contained in:
@@ -39,7 +39,7 @@ export default () => ({
|
|||||||
['@convert-to-native.window'](event){
|
['@convert-to-native.window'](event){
|
||||||
this.convertToNative = event.detail;
|
this.convertToNative = event.detail;
|
||||||
this.accountList = [];
|
this.accountList = [];
|
||||||
console.log('I heard that!');
|
console.log('I heard that! (dashboard/boxes)');
|
||||||
this.boxData = null;
|
this.boxData = null;
|
||||||
this.loadBoxes();
|
this.loadBoxes();
|
||||||
}
|
}
|
||||||
|
@@ -71,9 +71,10 @@ let index = function () {
|
|||||||
return {
|
return {
|
||||||
convertToNative: false,
|
convertToNative: false,
|
||||||
saveNativeSettings(event) {
|
saveNativeSettings(event) {
|
||||||
setVariable('convert_to_native', event.currentTarget.checked);
|
setVariable('convert_to_native', event.currentTarget.checked).then(() => {
|
||||||
|
console.log('Set convert to native to: ', event.currentTarget.checked);
|
||||||
this.$dispatch('convert-to-native', event.currentTarget.checked);
|
this.$dispatch('convert-to-native', event.currentTarget.checked);
|
||||||
console.log('saveNativeSettings + dispatch.');
|
});
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
|
Promise.all([getVariable('convert_to_native', false)]).then((values) => {
|
||||||
|
@@ -35,8 +35,9 @@ export function setVariable(name, value = null) {
|
|||||||
|
|
||||||
// post to user preferences (because why not):
|
// post to user preferences (because why not):
|
||||||
let putter = new Put();
|
let putter = new Put();
|
||||||
putter.put(name, value).then((response) => {
|
return putter.put(name, value).then((response) => {
|
||||||
console.log('set "'+name+'" to value: ', value);
|
console.log('set "'+name+'" to value: ', value);
|
||||||
|
return Promise.resolve(response);
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
// preference does not exist (yet).
|
// preference does not exist (yet).
|
||||||
@@ -44,6 +45,8 @@ export function setVariable(name, value = null) {
|
|||||||
let poster = (new Post);
|
let poster = (new Post);
|
||||||
poster.post(name, value).then((response) => {
|
poster.post(name, value).then((response) => {
|
||||||
console.log('POST "'+name+'" to value: ', value);
|
console.log('POST "'+name+'" to value: ', value);
|
||||||
|
return Promise.resolve(response);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user