code refactor
This commit is contained in:
@@ -94,7 +94,7 @@ function getItemValue(item: unknown, index: number, fieldName: string | undefine
|
||||
}
|
||||
}
|
||||
|
||||
function close() {
|
||||
function close(): void {
|
||||
emit('update:show', false);
|
||||
}
|
||||
|
||||
|
||||
@@ -136,13 +136,13 @@ function changeFrequencyValue(e: Event): void {
|
||||
}
|
||||
}
|
||||
|
||||
function save() {
|
||||
function save(): void {
|
||||
emit('update:type', currentFrequencyType.value);
|
||||
emit('update:modelValue', sortNumbersArray(currentFrequencyValue.value).join(','));
|
||||
emit('update:show', false);
|
||||
}
|
||||
|
||||
function close() {
|
||||
function close(): void {
|
||||
emit('update:show', false);
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ function onSheetOpen(event: { $el: Framework7Dom }): void {
|
||||
scrollToSelectedItem(event.$el, '.schedule-frequency-value-container', 'li.list-item-selected');
|
||||
}
|
||||
|
||||
function onSheetClosed() {
|
||||
function onSheetClosed(): void {
|
||||
close();
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -151,7 +151,7 @@ function onSheetOpen(event: { $el: Framework7Dom }): void {
|
||||
scrollToSelectedItem(event.$el, '.page-content', '.treeview-item .treeview-item-selected');
|
||||
}
|
||||
|
||||
function onSheetClosed() {
|
||||
function onSheetClosed(): void {
|
||||
emit('update:show', false);
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -133,7 +133,7 @@ const selectedPrimaryItem = computed<unknown>(() => {
|
||||
}
|
||||
});
|
||||
|
||||
function close() {
|
||||
function close(): void {
|
||||
emit('update:show', false);
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ function onSheetOpen(event: { $el: Framework7Dom }): void {
|
||||
scrollToSelectedItem(event.$el, '.secondary-list-container', 'li.secondary-list-item-selected');
|
||||
}
|
||||
|
||||
function onSheetClosed() {
|
||||
function onSheetClosed(): void {
|
||||
close();
|
||||
}
|
||||
</script>
|
||||
|
||||
+2
-2
@@ -143,11 +143,11 @@ export function getTimezoneOffsetMinutes(timezone?: string): number {
|
||||
}
|
||||
}
|
||||
|
||||
export function getBrowserTimezoneOffset() {
|
||||
export function getBrowserTimezoneOffset(): string {
|
||||
return getUtcOffsetByUtcOffsetMinutes(getBrowserTimezoneOffsetMinutes());
|
||||
}
|
||||
|
||||
export function getBrowserTimezoneOffsetMinutes() {
|
||||
export function getBrowserTimezoneOffsetMinutes(): number {
|
||||
return -new Date().getTimezoneOffset();
|
||||
}
|
||||
|
||||
|
||||
@@ -84,7 +84,7 @@ export function showLoading(delayConditionFunc?: () => boolean, delayMills?: num
|
||||
});
|
||||
}
|
||||
|
||||
export function hideLoading() {
|
||||
export function hideLoading(): void {
|
||||
f7ready((f7) => {
|
||||
return f7.preloader.hide();
|
||||
});
|
||||
|
||||
@@ -568,7 +568,7 @@ export function useI18n() {
|
||||
return getLanguageInfo(getDefaultLanguage()) as LanguageInfo;
|
||||
}
|
||||
|
||||
function getCurrentLanguageDisplayName() {
|
||||
function getCurrentLanguageDisplayName(): string {
|
||||
const currentLanguageInfo = getCurrentLanguageInfo();
|
||||
return currentLanguageInfo.displayName;
|
||||
}
|
||||
@@ -1175,27 +1175,27 @@ export function useI18n() {
|
||||
return t(`currency.name.${currencyCode}`);
|
||||
}
|
||||
|
||||
function isLongDateMonthAfterYear() {
|
||||
function isLongDateMonthAfterYear():boolean {
|
||||
return getLocalizedDateTimeType(LongDateFormat.all(), LongDateFormat.values(), userStore.currentUserLongDateFormat, 'longDateFormat', LongDateFormat.Default).isMonthAfterYear;
|
||||
}
|
||||
|
||||
function isShortDateMonthAfterYear() {
|
||||
function isShortDateMonthAfterYear():boolean {
|
||||
return getLocalizedDateTimeType(ShortDateFormat.all(), ShortDateFormat.values(), userStore.currentUserShortDateFormat, 'shortDateFormat', ShortDateFormat.Default).isMonthAfterYear;
|
||||
}
|
||||
|
||||
function isLongTime24HourFormat() {
|
||||
function isLongTime24HourFormat():boolean {
|
||||
return getLocalizedDateTimeType(LongTimeFormat.all(), LongTimeFormat.values(), userStore.currentUserLongTimeFormat, 'longTimeFormat', LongTimeFormat.Default).is24HourFormat;
|
||||
}
|
||||
|
||||
function isLongTimeMeridiemIndicatorFirst() {
|
||||
function isLongTimeMeridiemIndicatorFirst():boolean {
|
||||
return getLocalizedDateTimeType(LongTimeFormat.all(), LongTimeFormat.values(), userStore.currentUserLongTimeFormat, 'longTimeFormat', LongTimeFormat.Default).isMeridiemIndicatorFirst;
|
||||
}
|
||||
|
||||
function isShortTime24HourFormat() {
|
||||
function isShortTime24HourFormat():boolean {
|
||||
return getLocalizedDateTimeType(ShortTimeFormat.all(), ShortTimeFormat.values(), userStore.currentUserShortTimeFormat, 'shortTimeFormat', ShortTimeFormat.Default).is24HourFormat;
|
||||
}
|
||||
|
||||
function isShortTimeMeridiemIndicatorFirst() {
|
||||
function isShortTimeMeridiemIndicatorFirst():boolean {
|
||||
return getLocalizedDateTimeType(ShortTimeFormat.all(), ShortTimeFormat.values(), userStore.currentUserShortTimeFormat, 'shortTimeFormat', ShortTimeFormat.Default).isMeridiemIndicatorFirst;
|
||||
}
|
||||
|
||||
|
||||
@@ -270,7 +270,7 @@ export const useOverviewStore = defineStore('overview', () => {
|
||||
transactionOverviewStateInvalid.value = invalidState;
|
||||
}
|
||||
|
||||
function resetTransactionOverview() {
|
||||
function resetTransactionOverview(): void {
|
||||
updateTransactionDateRange();
|
||||
transactionOverviewOptions.value.loadLast11Months = false;
|
||||
transactionOverviewData.value = {};
|
||||
|
||||
@@ -133,7 +133,7 @@ function getCategoryTypeName(categoryType: CategoryType): string {
|
||||
}
|
||||
}
|
||||
|
||||
function save() {
|
||||
function save(): void {
|
||||
submitting.value = true;
|
||||
|
||||
const submitCategories = categorizedArrayToPlainArray(allPresetCategories.value);
|
||||
|
||||
@@ -134,13 +134,13 @@ const exchangeRatesLastUpdateDate = computed<string>(() => {
|
||||
return exchangeRatesLastUpdateTime ? formatUnixTimeToLongDate(exchangeRatesLastUpdateTime) : '';
|
||||
});
|
||||
|
||||
function switchToDesktopVersion() {
|
||||
function switchToDesktopVersion(): void {
|
||||
showConfirm('Are you sure you want to switch to desktop version?', () => {
|
||||
window.location.replace(getDesktopVersionPath());
|
||||
});
|
||||
}
|
||||
|
||||
function logout() {
|
||||
function logout(): void {
|
||||
showConfirm('Are you sure you want to log out?', () => {
|
||||
logouting.value = true;
|
||||
showLoading(() => logouting.value);
|
||||
|
||||
Reference in New Issue
Block a user