mirror of
https://github.com/unraid/api.git
synced 2025-12-30 21:19:49 -06:00
refactor: optional chaining for click props
This commit is contained in:
@@ -26,7 +26,7 @@ const { authAction, stateData } = storeToRefs(serverStore);
|
||||
size="12px"
|
||||
:text="t(authAction.text)"
|
||||
:title="authAction?.title ? t(authAction?.title) : undefined"
|
||||
@click="authAction.click ? authAction.click() : undefined"
|
||||
@click="authAction.click?.()"
|
||||
/>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -92,7 +92,7 @@ const updateOsStatus = computed(() => {
|
||||
:href="updateOsStatus.href ?? undefined"
|
||||
:title="updateOsStatus.title ?? undefined"
|
||||
class="group"
|
||||
@click="updateOsStatus.click ? updateOsStatus.click() : undefined"
|
||||
@click="updateOsStatus.click?.()"
|
||||
>
|
||||
<UiBadge
|
||||
v-if="updateOsStatus.badge"
|
||||
|
||||
@@ -50,7 +50,7 @@ const filteredKeyActions = computed((): ServerStateDataAction[] | undefined => {
|
||||
:icon-right-hover-display="true"
|
||||
:text="t(action.text)"
|
||||
:title="action.title ? t(action.title) : undefined"
|
||||
@click="action.click ? action.click() : undefined"
|
||||
@click="action.click?.()"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -244,7 +244,7 @@ const items = computed((): RegistrationItemProps[] => {
|
||||
:icon="authAction.icon"
|
||||
:text="t(authAction.text)"
|
||||
:title="authAction.title ? t(authAction.title) : undefined"
|
||||
@click="authAction.click ? authAction.click() : undefined"
|
||||
@click="authAction.click?.()"
|
||||
/>
|
||||
</span>
|
||||
</header>
|
||||
|
||||
@@ -76,7 +76,7 @@ const output = computed(() => {
|
||||
:text="t('Extend License')"
|
||||
:title="t('Pay your annual fee to continue receiving OS updates.')"
|
||||
class="flex-grow"
|
||||
@click="renewAction.click ? renewAction.click() : undefined"
|
||||
@click="renewAction.click?.()"
|
||||
/>
|
||||
|
||||
<BrandButton
|
||||
|
||||
@@ -256,7 +256,7 @@ const modalWidth = computed(() => {
|
||||
:icon-right-hover-display="item.iconRightHoverDisplay"
|
||||
:text="t(item.text ?? '')"
|
||||
:title="item.title ? t(item.title) : undefined"
|
||||
@click="item.click ? item.click() : undefined"
|
||||
@click="item.click?.()"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -326,7 +326,7 @@ const modalWidth = computed(() => {
|
||||
:icon-right-hover-display="item.iconRightHoverDisplay"
|
||||
:text="t(item.text ?? '')"
|
||||
:title="item.title ? t(item.title) : undefined"
|
||||
@click="item.click ? item.click() : undefined"
|
||||
@click="item.click?.()"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -95,7 +95,7 @@ watchEffect(() => {
|
||||
:text="t('Extend License')"
|
||||
:title="t('Pay your annual fee to continue receiving OS updates.')"
|
||||
class="flex-grow"
|
||||
@click="renewAction.click ? renewAction.click() : undefined"
|
||||
@click="renewAction.click?.()"
|
||||
/>
|
||||
<!-- <BrandButton
|
||||
btn-style="black"
|
||||
|
||||
@@ -41,7 +41,7 @@ const showExpireTime = computed(() => (state.value === 'TRIAL' || state.value ==
|
||||
:icon="unraidApiStatus === 'restarting' ? BrandLoadingWhite : unraidApiRestartAction?.icon"
|
||||
:text="unraidApiStatus === 'restarting' ? t('Restarting unraid-api…') : t('Restart unraid-api')"
|
||||
:title="unraidApiStatus === 'restarting' ? t('Restarting unraid-api…') : t('Restart unraid-api')"
|
||||
@click="unraidApiRestartAction?.click ? unraidApiRestartAction?.click() : undefined"
|
||||
@click="unraidApiRestartAction?.click?.()"
|
||||
/>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
@@ -23,7 +23,7 @@ const upgradeAction = computed((): ServerStateDataAction | undefined => {
|
||||
<UpcServerStateBuy
|
||||
class="text-gamma"
|
||||
:title="t('Upgrade Key')"
|
||||
@click="upgradeAction.click ? upgradeAction.click() : undefined"
|
||||
@click="upgradeAction.click?.()"
|
||||
>
|
||||
<h5>Unraid OS <em><strong>{{ t(stateData.humanReadable) }}</strong></em></h5>
|
||||
</UpcServerStateBuy>
|
||||
@@ -36,7 +36,7 @@ const upgradeAction = computed((): ServerStateDataAction | undefined => {
|
||||
<UpcServerStateBuy
|
||||
class="text-orange-dark relative top-[1px] hidden sm:block"
|
||||
:title="t('Purchase Key')"
|
||||
@click="purchaseAction.click ? purchaseAction.click() : undefined"
|
||||
@click="purchaseAction.click?.()"
|
||||
>{{ t('Purchase') }}</UpcServerStateBuy>
|
||||
</template>
|
||||
</span>
|
||||
|
||||
Reference in New Issue
Block a user