Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion src/view/Office.vue
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,6 @@ export default {
},
},
async mounted() {
// Store and update favicon
this.storeFavicon()
this.updateFavicon()

Expand Down Expand Up @@ -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"]')
Expand Down
1 change: 1 addition & 0 deletions tests/stub.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -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 {};
Expand Down
Loading