Skip to content

Commit

Permalink
PR-related fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamlangford committed Apr 25, 2024
1 parent f49232d commit 0c221cf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions src/background/installer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,11 @@ export async function openInstallPage() {
// Case 3: there's no Admin Console onboarding tab open

if (appOnboardingTab) {
const appOnboardingTabUrl = new URL(appOnboardingTab.url ?? "");
const appOnboardingTabUrl = appOnboardingTab?.url
? new URL(appOnboardingTab.url)
: null;

if (appOnboardingTabUrl.pathname === "/start") {
if (appOnboardingTabUrl?.pathname === "/start") {
// Case 1a/1b: Admin Console is showing a partner onboarding flow

const controlRoomHostname =
Expand Down
2 changes: 1 addition & 1 deletion src/contentScript/pageEditor/selectElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export default async function selectElement({
root?: string;
excludeRandomClasses?: boolean;
}): Promise<ElementInfo> {
const rootElements = $safeFind(root ?? "").get();
const rootElements = root ? $safeFind(root).get() : [];

if (root && rootElements.length === 0) {
throw new NoElementsFoundError(root);
Expand Down
4 changes: 2 additions & 2 deletions src/extensionConsole/pages/UpdateBanner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { getExtensionVersion } from "@/utils/extensionUtils";

// XXX: move this kind of async state to the Redux state.
export function useUpdateAvailable(): boolean {
const { data: updateAvailable } = useAsyncState(async () => {
const { data: updateAvailable = false } = useAsyncState(async () => {
try {
const available = await getAvailableVersion();
const installed = getExtensionVersion();
Expand All @@ -37,7 +37,7 @@ export function useUpdateAvailable(): boolean {
}
}, []);

return Boolean(updateAvailable);
return updateAvailable;
}

const UpdateBanner: React.FunctionComponent = () => {
Expand Down

0 comments on commit 0c221cf

Please sign in to comment.