Skip to content

Firefly III: a personal finances manager

Add popups for whats new dialog

Sander Dorigoe5f2e518daf6
diff --git a/app/Api/V1/Controllers/User/PreferencesController.php b/app/Api/V1/Controllers/User/PreferencesController.php
index 4137bd4c4c..f42ce7686e 100644
--- a/app/Api/V1/Controllers/User/PreferencesController.php
+++ b/app/Api/V1/Controllers/User/PreferencesController.php
@@ -104,7 +104,6 @@ final class PreferencesController extends Controller
$manager = $this->getManager();
$count = $preferenceList->count();
$names = implode(',', $preferenceList->pluck('name')->toArray());
- var_dump($names);exit;
// make paginator:
$paginator = new LengthAwarePaginator($preferenceList, $count, 31_337, 1);
@@ -115,7 +114,6 @@ final class PreferencesController extends Controller
$resource = new FractalCollection($preferenceList, $transformer, self::RESOURCE_KEY);
$resource->setPaginator(new IlluminatePaginatorAdapter($paginator));
- die('here we are2');
return response()->json($manager->createData($resource)->toArray())->header('Content-Type', self::CONTENT_TYPE);
}
diff --git a/app/Support/Binder/PreferenceList.php b/app/Support/Binder/PreferenceList.php
index 08f0357ae8..6b22fcef54 100644
--- a/app/Support/Binder/PreferenceList.php
+++ b/app/Support/Binder/PreferenceList.php
@@ -52,7 +52,7 @@ class PreferenceList implements BinderInterface
foreach ($list as $item) {
$current = Preferences::get($item);
if (null === $current) {
- $current = Preferences::set($item, null, false);
+ $current = Preferences::set($item, null);
}
if (null !== $current) {
Log::debug(sprintf('Add %s to the result', $item));
diff --git a/app/Support/Preferences.php b/app/Support/Preferences.php
index 2183d484a4..d1ba6a1bcf 100644
--- a/app/Support/Preferences.php
+++ b/app/Support/Preferences.php
@@ -358,11 +358,20 @@ class Preferences
if (null !== $preference && null === $value) {
$preference->delete();
-
- return new Preference();
+ $new = new Preference;
+ $new->created_at = now();
+ $new->updated_at= now();
+ $new->name = $name;
+ $new->value = null;
+ return $new;
}
if (null === $value) {
- return new Preference();
+ $new = new Preference;
+ $new->created_at = now();
+ $new->updated_at= now();
+ $new->name = $name;
+ $new->value = null;
+ return $new;
}
if (null === $preference) {
$preference = new Preference();
diff --git a/resources/assets/v3/js/pages/dashboard/dashboard.js b/resources/assets/v3/js/pages/dashboard/dashboard.js
index b2f02e8a42..a1eb49fb17 100644
--- a/resources/assets/v3/js/pages/dashboard/dashboard.js
+++ b/resources/assets/v3/js/pages/dashboard/dashboard.js
@@ -43,8 +43,11 @@ let index = function () {
const whatsNewDialog = 'wn_' + version;
const lastTimeDialog = 'lt_' + version;
getVariables([whatsNewDialog, lastTimeDialog]).then((values) => {
- alert(whatsNewDialog + ' is ' + values.whatsNewDialog);
- alert(lastTimeDialog + ' is ' + values.lastTimeDialog);
+ const shownWhatsNewDialog = true === values[whatsNewDialog];
+ const lastShowTime = null === values[lastTimeDialog] ? 0 : parseInt(values[lastTimeDialog]);
+ console.log(lastShowTime);
+ // alert(whatsNewDialog + ' is ' + (null === values[whatsNewDialog]));
+ // alert(lastTimeDialog + ' is ' + (null === values[lastTimeDialog]));
});
}