()
| 5 | import { fetchUpdate } from '../lib/updater'; |
| 6 | |
| 7 | async function doCheckUpdate() { |
| 8 | const update = await fetchUpdate(); |
| 9 | if (update === false) return; |
| 10 | |
| 11 | toast.custom((t) => { |
| 12 | return ( |
| 13 | <div class={`${!t.visible && 'hidden'} relative w-[370px] bg-white shadow-lg rounded-lg pointer-events-auto ring-1 ring-black ring-opacity-5 overflow-hidden`}> |
| 14 | <div class="p-2"> |
| 15 | <div class="flex items-start"> |
| 16 | <div class="flex-shrink-0 pt-[2px] text-gray-600"> |
| 17 | <svg width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"> |
| 18 | <path stroke="none" d="M0 0h24v24H0z" fill="none"></path> |
| 19 | <path d="M9 12h-3.586a1 1 0 0 1 -.707 -1.707l6.586 -6.586a1 1 0 0 1 1.414 0l6.586 6.586a1 1 0 0 1 -.707 1.707h-3.586v3h-6v-3z"></path> |
| 20 | <path d="M9 21h6"></path> |
| 21 | <path d="M9 18h6"></path> |
| 22 | </svg> |
| 23 | </div> |
| 24 | <div class="ml-3 w-0 flex-1 pt-0.5"> |
| 25 | <p class="text-sm font-bold text-sky-500">{_t('update_available')} - {update.version}</p> |
| 26 | <p class="mt-1 text-sm text-gray-700">{_t('update_hint')}</p> |
| 27 | </div> |
| 28 | <div class="ml-4 flex-shrink-0 flex"> |
| 29 | <button |
| 30 | class="bg-white rounded-md inline-flex text-gray-400 hover:text-gray-500" |
| 31 | onClick={() => toast.dismiss(t.id)} |
| 32 | > |
| 33 | <svg class="h-5 w-5" viewBox="0 0 20 20" fill="currentColor"> |
| 34 | <path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd" /> |
| 35 | </svg> |
| 36 | </button> |
| 37 | </div> |
| 38 | </div> |
| 39 | </div> |
| 40 | |
| 41 | </div> |
| 42 | ) |
| 43 | }, { duration: 30000, position: 'bottom-left' }); |
| 44 | } |
| 45 | |
| 46 | export function Welcome() { |
| 47 |
nothing calls this directly
no test coverage detected