Skip to content

Commit

Permalink
fix(internal): do not flood the logs with unecessary warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Joedmin committed Oct 30, 2024
1 parent 1cba089 commit 9842113
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Controllers/readeckButtonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,21 @@ public function revokeAccessAction(): void
// TODO: remove this method after the next 2 versions - all users should've already been migrated, hopefuly
private function migrateConfigvariables(): void
{
$migrated = FreshRSS_Context::userConf()->attributeBool('readeck_migrated');
if ($migrated) {
// Already migrated.
return;
}

$username = FreshRSS_Context::userConf()->attributeString('username');
$keyboard_shortcut = FreshRSS_Context::userConf()->attributeString('keyboard_shortcut');
$instance_url = FreshRSS_Context::userConf()->attributeString('instance_api_url');
$api_token = FreshRSS_Context::userConf()->attributeString('api_token');

if (!isset($username) && !isset($instance_url) && !isset($api_token))
{
if (!isset($username) && !isset($instance_url) && !isset($api_token)) {
// Already migrated.
FreshRSS_Context::userConf()->_attribute('readeck_migrated', true);
FreshRSS_Context::userConf()->save();
return;
}

Expand Down Expand Up @@ -114,6 +121,7 @@ private function migrateConfigvariables(): void
}

// Migration complete
FreshRSS_Context::userConf()->_attribute('readeck_migrated', true);
FreshRSS_Context::userConf()->save();
}

Expand Down

0 comments on commit 9842113

Please sign in to comment.