Skip to content

Commit

Permalink
fix: if user is deleted, show ghost (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelkristiansson authored Oct 4, 2024
1 parent 24b2c61 commit 7bdbcb7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions src/components/Reviews.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,16 @@
$github.fetchReviews($auth.account, $auth.githubSettings);
dateUpdater++;
const ele = document.getElementById('reviews');
setWindowSize(ele.clientHeight);
if (ele) {
setWindowSize(ele.clientHeight);
}
}, $auth.settings.fetchInterval || defaultSettings.fetchInterval);
const onLoad = (ele: Element) => {
setTimeout(() => {
setWindowSize(ele.clientHeight);
if (ele) {
setWindowSize(ele.clientHeight);
}
}, 100);
};
Expand Down Expand Up @@ -144,7 +148,7 @@
<div class="flex flex-row items-center gap-1">
{#key dateUpdater}
<span class="text-sm text-gray-500 truncate dark:text-gray-400">
{timeAgo(review.node.createdAt)} by @{review.node.author.login}
{timeAgo(review.node.createdAt)} by @{review.node.author?.login || 'ghost'}
</span>
{/key}
<span
Expand Down
2 changes: 1 addition & 1 deletion src/lib/window-size.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { appWindow, LogicalSize } from '@tauri-apps/api/window';
const DEFAULT_HEIGHT = 400;
const DEFAULT_WIDTH = 500;
const FOOTER_HEIGHT = 56;
const MIN_HEIGHT = 100;
const MIN_HEIGHT = 120;

export const resetWindowSize = async () => await appWindow.setSize(new LogicalSize(DEFAULT_WIDTH, DEFAULT_HEIGHT));

Expand Down

0 comments on commit 7bdbcb7

Please sign in to comment.