Skip to content

Commit

Permalink
[fix] news notification doesn't disappear bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelfolaron committed May 2, 2024
1 parent 3458523 commit ef6a6c6
Show file tree
Hide file tree
Showing 7 changed files with 154 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .idea/codeception.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

71 changes: 71 additions & 0 deletions .idea/leantime-oss.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

67 changes: 67 additions & 0 deletions .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/phpspec.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion app/Domain/Menu/Repositories/Menu.php
Expand Up @@ -124,7 +124,6 @@ class Menu
5 => ['type' => 'item', 'module' => 'plugins', 'title' => 'menu.leantime_apps', 'icon' => 'fa fa-fw fa-puzzle-piece', 'tooltip' => 'menu.leantime_apps_tooltip', 'href' => '/plugins/marketplace', 'active' => ['marketplace', 'myapps']],
10 => ['type' => 'item', 'module' => 'connector', 'title' => 'menu.integrations', 'icon' => 'fa fa-fw fa-circle-nodes', 'tooltip' => 'menu.connector_tooltip', 'href' => '/connector/show', 'active' => ['show']],
15 => ['type' => 'item', 'module' => 'setting', 'title' => 'menu.company_settings', 'icon' => 'fa fa-fw fa-cogs', 'tooltip' => 'menu.company_settings_tooltip', 'href' => '/setting/editCompanySettings', 'active' => ['editCompanySettings']],

20 => ['type' => 'item', 'module' => 'notes', 'title' => 'menu.customfields_premium', 'icon' => 'fa fa-solid fa-list', 'tooltip' => 'Custom Fields', 'href' => '/plugins/marketplace#/plugins/details/leantime_customfields', 'role' => 'editor'],

],
Expand Down
6 changes: 3 additions & 3 deletions app/Domain/Notifications/Services/News.php
Expand Up @@ -51,8 +51,8 @@ public function getLatest(int $userId): false|\SimpleXMLElement

$rss = $this->getFeed();

$latestGuid = $rss?->channel?->item[0]?->guid;
$this->settingService->saveSetting("usersettings.".$userId.".lastNewsGuid", $latestGuid);
$latestGuid = strval($rss?->channel?->item[0]?->guid);
$this->settingService->saveSetting("usersettings.".$userId.".lastNewsGuid", strval($latestGuid));

//Todo: check last article the user read
//Only load rss feed once a day
Expand All @@ -65,7 +65,7 @@ public function hasNews(int $userId): bool

$rss = $this->getFeed();

$latestGuid = $rss?->channel?->item[0]?->guid;
$latestGuid = strval($rss?->channel?->item[0]?->guid);

$lastNewsGuid = $this->settingService->getSetting("usersettings.".$userId.".lastNewsGuid");

Expand Down
2 changes: 1 addition & 1 deletion app/Plugins

0 comments on commit ef6a6c6

Please sign in to comment.