Ariver
2026-05-18 db6aabfb7aa4460c8858fec0a51534ebe34786f7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<script lang="ts">
  import { Call } from '@wailsio/runtime'
  import { t } from '../../lib/i18n'
  import type { UpdateInfo } from '../../lib/stores/update'
  import { updateDownloading } from '../../lib/stores/update'
 
  interface Props {
    info: UpdateInfo
    onclose: () => void
  }
 
  let { info, onclose }: Props = $props()
  let downloading = $state(false)
 
  async function doUpdate() {
    downloading = true
    updateDownloading.set(true)
    try {
      await Call.ByName('voicesnap/services.UpdaterService.PerformUpdate', info.downloadUrl)
    } catch (err) {
      downloading = false
      updateDownloading.set(false)
    }
  }
</script>
 
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div class="overlay" onclick={onclose} role="dialog">
  <!-- svelte-ignore a11y_click_events_have_key_events -->
  <div class="dialog" onclick={(e) => e.stopPropagation()} role="document">
    <h2 class="title">{t('update.title')}</h2>
    <p class="version">{t('update.version', { version: info.version })}</p>
 
    {#if info.releaseNotes}
      <div class="notes">
        <h3 class="notes-title">{t('update.releaseNotes')}</h3>
        <p class="notes-content">{info.releaseNotes}</p>
      </div>
    {/if}
 
    <div class="actions">
      <button class="btn btn-secondary" onclick={onclose} disabled={downloading}>
        {t('update.later')}
      </button>
      <button class="btn btn-primary" onclick={doUpdate} disabled={downloading}>
        {downloading ? t('update.downloading') : t('update.download')}
      </button>
    </div>
  </div>
</div>
 
<style>
  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
  }
 
  .dialog {
    background: var(--color-bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xxl);
    max-width: 420px;
    width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
  }
 
  .title {
    font-size: var(--font-size-xl);
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
  }
 
  .version {
    font-size: var(--font-size-sm);
    color: var(--color-secondary-label);
    margin-bottom: var(--spacing-lg);
  }
 
  .notes {
    background: var(--color-bg-secondary);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }
 
  .notes-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
  }
 
  .notes-content {
    font-size: var(--font-size-sm);
    color: var(--color-secondary-label);
    line-height: 1.5;
    white-space: pre-wrap;
  }
 
  .actions {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: flex-end;
  }
 
  .btn {
    padding: 8px 20px;
    border-radius: var(--radius-sm);
    font-size: var(--font-size-sm);
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity var(--transition-fast);
  }
 
  .btn:hover { opacity: 0.85; }
  .btn:disabled { opacity: 0.5; cursor: not-allowed; }
 
  .btn-secondary {
    background: var(--color-bg-secondary);
    color: var(--color-label);
  }
 
  .btn-primary {
    background: var(--color-blue);
    color: white;
  }
</style>