Skip to content

Commit

Permalink
add script differently depending on the version of nextcloud
Browse files Browse the repository at this point in the history
Signed-off-by: Artur Neumann <artur@jankaritech.com>
  • Loading branch information
individual-it committed Feb 15, 2022
1 parent 9ee0754 commit d71b786
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/Listener/LoadSidebarScript.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,14 @@ public function handle(Event $event): void {
if (!($event instanceof LoadSidebar)) {
return;
}
Util::addScript(Application::APP_ID, 'integration_openproject-projectTab', 'files');
$currentVersion = implode('.', Util::getVersion());
//changed from nextcloud 24
if (version_compare($currentVersion, '24') >= 0) {
// @phpstan-ignore-next-line
Util::addScript(Application::APP_ID, 'integration_openproject-projectTab', 'files');
} else {
Util::addScript(Application::APP_ID, 'integration_openproject-projectTab');
}
Util::addStyle(Application::APP_ID, 'tab');
}
}

0 comments on commit d71b786

Please sign in to comment.