Skip to content

Commit 47a9d43

Browse files
committed
fixup! Add LoadViewer event
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
1 parent 7650c35 commit 47a9d43

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

appinfo/app.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@
2424
namespace OCA\Viewer\AppInfo;
2525

2626
// Query the app instance in the hope it's instantiated exactly once
27-
OC::$server->query(\OCA\Viewer\AppInfo\Application::class);
27+
\OC::$server->query(\OCA\Viewer\AppInfo\Application::class);

lib/Listener/LoadViewerScript.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,14 @@
2626

2727
use OCA\Viewer\AppInfo\Application;
2828
use OCA\Viewer\Event\LoadViewer;
29+
use OCA\Files\Event\LoadAdditionalScriptsEvent;
2930
use OCP\EventDispatcher\Event;
3031
use OCP\EventDispatcher\IEventListener;
3132
use OCP\Util;
3233

3334
class LoadViewerScript implements IEventListener {
3435
public function handle(Event $event): void {
35-
if (!($event instanceof LoadViewer)) {
36+
if (!($event instanceof LoadViewer || $event instanceof LoadAdditionalScriptsEvent)) {
3637
return;
3738
}
3839

src/services/Viewer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,14 +75,14 @@ export default class Viewer {
7575
* Get the current opened file
7676
*
7777
* @memberof Viewer
78-
* @returns {string}
78+
* @returns {string} the currently opened file
7979
*/
8080
get file() {
8181
return this.#state.file
8282
}
8383

8484
/**
85-
* Get the current opened file
85+
* Set the current opened file
8686
*
8787
* @param {string} path the path to open
8888
* @memberof Viewer

src/views/Viewer.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ export default {
297297
this.updatePreviousNext()
298298
} else {
299299
console.error(`The following file could not be displayed`, fileName, fileInfo)
300-
this.currentFile.failed = true
300+
this.close()
301301
}
302302
},
303303

0 commit comments

Comments
 (0)