Skip to content

Commit

Permalink
fixup! fix(widget): Implement icon handling for widget api
Browse files Browse the repository at this point in the history
  • Loading branch information
juliushaertl committed Jan 5, 2023
1 parent 6b3f457 commit 0afb961
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/AppInfo/DashboardWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,16 @@ public function getItems(string $userId, ?string $since = null, int $limit = 7):
} catch (\Throwable $e) {
}
$link = $this->url->linkToRouteAbsolute('notes.page.indexnote', ['id' => $note->getId()]);
$icon = $note->getFavorite() ? $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg')) : $this->getIconUrl();
$icon = $this->url->getAbsoluteURL(
$note->getFavorite()
? $this->url->getAbsoluteURL($this->url->imagePath('core', 'actions/starred.svg'))
: $this->getIconUrl()
);
return new WidgetItem($note->getTitle(), $excerpt, $link, $icon, (string)$note->getModified());
}, $notes);
}

public function getIconUrl(): string {
return $this->url->imagePath('notes', 'notes-dark.svg');
return $this->url->getAbsoluteURL($this->url->imagePath('notes', 'notes-dark.svg'));
}
}

0 comments on commit 0afb961

Please sign in to comment.