Skip to content

Commit f153cac

Browse files
authored
Merge pull request #5256 from nextcloud/fix/favicon
fix: Re-add missing methods
2 parents 0c428f9 + a7de691 commit f153cac

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

src/view/Office.vue

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ export default {
260260
},
261261
},
262262
async mounted() {
263-
// Store and update favicon
264263
this.storeFavicon()
265264
this.updateFavicon()
266265
@@ -574,6 +573,25 @@ export default {
574573
return 'x-office-document'
575574
},
576575
576+
storeFavicon() {
577+
const link = document.querySelector('link[rel*="icon"]')
578+
if (link) {
579+
this.originalFavicon = link.href
580+
}
581+
},
582+
583+
updateFavicon() {
584+
const link = document.querySelector('link[rel*="icon"]')
585+
if (link) {
586+
const iconPath = generateFilePath(
587+
'richdocuments',
588+
'img',
589+
this.getDocumentTypeIcon() + '.svg',
590+
)
591+
link.href = window.location.protocol + '//' + getNextcloudUrl() + iconPath
592+
}
593+
},
594+
577595
restoreFavicon() {
578596
if (this.originalFavicon) {
579597
const link = document.querySelector('link[rel*="icon"]')

tests/stub.phpstub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ namespace OC\Files\Storage\Wrapper {
6363
public function getInstanceOfStorage(string $class): ?IStorage {};
6464
public function __call(string $method, array $args) {};
6565
public function getDirectDownload(string $path): array|false {};
66+
public function getDirectDownloadById(string $fileId): array|false {};
6667
public function getAvailability(): array {};
6768
public function setAvailability(bool $isAvailable): void {};
6869
public function verifyPath(string $path, string $fileName): void {};

0 commit comments

Comments
 (0)