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