-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Fix files_sharing app LoadSidebar event #17821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| <?php | ||
| declare(strict_types=1); | ||
| /** | ||
| * @copyright Copyright (c) 2019, Roeland Jago Douma <roeland@famdouma.nl> | ||
| * | ||
| * @author Roeland Jago Douma <roeland@famdouma.nl> | ||
| * @author John Molakvoæ <skjnldsv@protonmail.com> | ||
| * | ||
| * @license GNU AGPL version 3 or any later version | ||
| * | ||
| * This program is free software: you can redistribute it and/or modify | ||
| * it under the terms of the GNU Affero General Public License as | ||
| * published by the Free Software Foundation, either version 3 of the | ||
| * License, or (at your option) any later version. | ||
| * | ||
| * This program is distributed in the hope that it will be useful, | ||
| * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| * GNU Affero General Public License for more details. | ||
| * | ||
| * You should have received a copy of the GNU Affero General Public License | ||
| * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| * | ||
| */ | ||
|
|
||
| namespace OCA\Files_Sharing\Listener; | ||
|
|
||
| use OCA\Files_Sharing\AppInfo\Application; | ||
| use OCA\Files\Event\LoadAdditionalScriptsEvent; | ||
| use OCP\EventDispatcher\Event; | ||
| use OCP\EventDispatcher\IEventListener; | ||
| use OCP\Util; | ||
|
|
||
| class LoadAdditionalListener implements IEventListener { | ||
| public function handle(Event $event): void { | ||
| if (!($event instanceof LoadAdditionalScriptsEvent)) { | ||
| return; | ||
| } | ||
|
|
||
| Util::addScript(Application::APP_ID, 'dist/files_sharing'); | ||
| Util::addScript(Application::APP_ID, 'dist/additionalScripts'); | ||
| Util::addStyle(Application::APP_ID, 'icons'); | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is where we broke the dispatch of addListener in line 214, where GenericEvent is type hinted in the callback, right @rullzer? That's what Psalm found in https://github.com/nextcloud/server/pull/23742/files#diff-f24715432b9a8ad98f1ff9c441096d8afd1ed1bcfb43f04a04ad2894e050e2a8R156
Nice catch by psalm I would say - cc @ChristophWurst @kesselb