diff --git a/src/view/Office.vue b/src/view/Office.vue index defe2d07e0..d930b786a4 100644 --- a/src/view/Office.vue +++ b/src/view/Office.vue @@ -260,7 +260,6 @@ export default { }, }, async mounted() { - // Store and update favicon this.storeFavicon() this.updateFavicon() @@ -574,6 +573,25 @@ export default { return 'x-office-document' }, + storeFavicon() { + const link = document.querySelector('link[rel*="icon"]') + if (link) { + this.originalFavicon = link.href + } + }, + + updateFavicon() { + const link = document.querySelector('link[rel*="icon"]') + if (link) { + const iconPath = generateFilePath( + 'richdocuments', + 'img', + this.getDocumentTypeIcon() + '.svg', + ) + link.href = window.location.protocol + '//' + getNextcloudUrl() + iconPath + } + }, + restoreFavicon() { if (this.originalFavicon) { const link = document.querySelector('link[rel*="icon"]') diff --git a/tests/stub.phpstub b/tests/stub.phpstub index 30bb9627b2..ae68e1845d 100644 --- a/tests/stub.phpstub +++ b/tests/stub.phpstub @@ -63,6 +63,7 @@ namespace OC\Files\Storage\Wrapper { public function getInstanceOfStorage(string $class): ?IStorage {}; public function __call(string $method, array $args) {}; public function getDirectDownload(string $path): array|false {}; + public function getDirectDownloadById(string $fileId): array|false {}; public function getAvailability(): array {}; public function setAvailability(bool $isAvailable): void {}; public function verifyPath(string $path, string $fileName): void {};