mirror of
				https://github.com/immich-app/immich.git
				synced 2025-11-03 19:29:32 -05:00 
			
		
		
		
	fix(web): show api key copy button in Firefox (#9704)
This commit is contained in:
		
							parent
							
								
									57d94bce68
								
							
						
					
					
						commit
						76fdcc9863
					
				@ -1,7 +1,7 @@
 | 
				
			|||||||
<script lang="ts">
 | 
					<script lang="ts">
 | 
				
			||||||
  import { copyToClipboard } from '$lib/utils';
 | 
					  import { copyToClipboard } from '$lib/utils';
 | 
				
			||||||
  import { mdiKeyVariant } from '@mdi/js';
 | 
					  import { mdiKeyVariant } from '@mdi/js';
 | 
				
			||||||
  import { createEventDispatcher, onMount } from 'svelte';
 | 
					  import { createEventDispatcher } from 'svelte';
 | 
				
			||||||
  import Button from '../elements/buttons/button.svelte';
 | 
					  import Button from '../elements/buttons/button.svelte';
 | 
				
			||||||
  import FullScreenModal from '../shared-components/full-screen-modal.svelte';
 | 
					  import FullScreenModal from '../shared-components/full-screen-modal.svelte';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -11,12 +11,6 @@
 | 
				
			|||||||
    done: void;
 | 
					    done: void;
 | 
				
			||||||
  }>();
 | 
					  }>();
 | 
				
			||||||
  const handleDone = () => dispatch('done');
 | 
					  const handleDone = () => dispatch('done');
 | 
				
			||||||
  let canCopyImagesToClipboard = true;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  onMount(async () => {
 | 
					 | 
				
			||||||
    const module = await import('copy-image-clipboard');
 | 
					 | 
				
			||||||
    canCopyImagesToClipboard = module.canCopyImagesToClipboard();
 | 
					 | 
				
			||||||
  });
 | 
					 | 
				
			||||||
</script>
 | 
					</script>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
<FullScreenModal id="api-key-secret-modal" title="API key" icon={mdiKeyVariant} onClose={() => handleDone()}>
 | 
					<FullScreenModal id="api-key-secret-modal" title="API key" icon={mdiKeyVariant} onClose={() => handleDone()}>
 | 
				
			||||||
@ -32,9 +26,7 @@
 | 
				
			|||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  <svelte:fragment slot="sticky-bottom">
 | 
					  <svelte:fragment slot="sticky-bottom">
 | 
				
			||||||
    {#if canCopyImagesToClipboard}
 | 
					    <Button on:click={() => copyToClipboard(secret)} fullwidth>Copy to Clipboard</Button>
 | 
				
			||||||
      <Button on:click={() => copyToClipboard(secret)} fullwidth>Copy to Clipboard</Button>
 | 
					 | 
				
			||||||
    {/if}
 | 
					 | 
				
			||||||
    <Button on:click={() => handleDone()} fullwidth>Done</Button>
 | 
					    <Button on:click={() => handleDone()} fullwidth>Done</Button>
 | 
				
			||||||
  </svelte:fragment>
 | 
					  </svelte:fragment>
 | 
				
			||||||
</FullScreenModal>
 | 
					</FullScreenModal>
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user