Fixed sheet search
This commit is contained in:
@@ -72,7 +72,7 @@
|
||||
selectedSheet.set(sheetData);
|
||||
}
|
||||
|
||||
let canProceed = $derived($selectedSheet !== null);
|
||||
let canProceed = $derived($selectedSheet.id !== '');
|
||||
</script>
|
||||
|
||||
<div class="p-6">
|
||||
@@ -137,8 +137,8 @@
|
||||
<div class="space-y-3">
|
||||
{#each searchResults as sheet}
|
||||
<div
|
||||
class="cursor-pointer rounded-lg border p-4 transition-colors hover:bg-gray-50 {$selectedSheet?.spreadsheetId ===
|
||||
(sheet.spreadsheetId || sheet.id)
|
||||
class="cursor-pointer rounded-lg border p-4 transition-colors hover:bg-gray-50 {$selectedSheet?.id ===
|
||||
(sheet.id || sheet.id)
|
||||
? 'border-blue-500 bg-blue-50'
|
||||
: 'border-gray-200'}"
|
||||
onclick={() => handleSelectSheet(sheet)}
|
||||
@@ -159,7 +159,7 @@
|
||||
<img src={sheet.iconLink} alt="Sheet icon" class="my-2 mr-2 h-5 w-5" />
|
||||
{/if}
|
||||
|
||||
{#if $selectedSheet?.spreadsheetId === (sheet.spreadsheetId || sheet.id)}
|
||||
{#if $selectedSheet?.id === (sheet.id || sheet.id)}
|
||||
<svg class="h-5 w-5 text-blue-600 my-2" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
@@ -201,8 +201,8 @@
|
||||
<div class="space-y-3">
|
||||
{#each recentSheets as sheet}
|
||||
<div
|
||||
class="cursor-pointer rounded-lg border p-4 transition-colors hover:bg-gray-50 {$selectedSheet?.spreadsheetId ===
|
||||
(sheet.spreadsheetId || sheet.id)
|
||||
class="cursor-pointer rounded-lg border p-4 transition-colors hover:bg-gray-50 {$selectedSheet?.id ===
|
||||
(sheet.id || sheet.id)
|
||||
? 'border-blue-500 bg-blue-50'
|
||||
: 'border-gray-200'}"
|
||||
onclick={() => handleSelectSheet(sheet)}
|
||||
@@ -223,7 +223,7 @@
|
||||
<img src={sheet.iconLink} alt="Sheet icon" class="mr-2 h-5 w-5" />
|
||||
{/if}
|
||||
|
||||
{#if $selectedSheet?.spreadsheetId === (sheet.spreadsheetId || sheet.id)}
|
||||
{#if $selectedSheet.id === sheet.id}
|
||||
<svg class="h-5 w-5 text-blue-600" fill="currentColor" viewBox="0 0 20 20">
|
||||
<path
|
||||
fill-rule="evenodd"
|
||||
|
||||
@@ -90,7 +90,7 @@ export const pictures = writable<Record<string, PictureBlobInfoType>>({});
|
||||
export const CropRects = writable<Record<string, CropType>>({});
|
||||
|
||||
// Store and hold the selected sheet
|
||||
export const selectedSheet = writable<SheetInfoType | null>(null);
|
||||
export const selectedSheet = writable<SheetInfoType>({ id: '', name: '', webViewLink: '' });
|
||||
|
||||
// Card details for generation
|
||||
export const cardDetails = writable<CardDetailsType | null>(null);
|
||||
|
||||
Reference in New Issue
Block a user