Skip to content

Commit ff909ce

Browse files
committed
formatting; externalise size var
1 parent 60c8c9c commit ff909ce

File tree

12 files changed

+17
-14
lines changed

12 files changed

+17
-14
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ charset = utf-8
55
indent_style = space
66
indent_size = 2
77
end_of_line = lf
8-
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

src/components/FileItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { computed, ref, watchEffect } from 'vue';
3-
import type { FileObj } from '../types/file';
4-
import { useI18n } from '../hooks/useI18n';
3+
import type { FileObj } from '@/types/file';
4+
import { useI18n } from '@/hooks/useI18n';
55
66
const { t } = useI18n();
77

src/components/FileUpload.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<script setup lang="ts">
22
import { ref } from 'vue';
3-
import { useFileDataStore } from '../stores/fileData';
3+
import { useFileDataStore } from '@/stores/fileData';
44
import { storeToRefs } from 'pinia';
5-
import type { FileObj } from '../types/file';
6-
import { useI18n } from '../hooks/useI18n';
5+
import type { FileObj } from '@/types/file';
6+
import { useI18n } from '@/hooks/useI18n';
77
88
const dragActive = ref(false);
99

src/components/NavBar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<script setup lang="ts">
22
import { watch, ref } from 'vue';
3-
import { useI18n } from '../hooks/useI18n';
3+
import { useI18n } from '@/hooks/useI18n';
44
import ThemeSwitch from './ThemeSwitch.vue';
55
66
const { t, locale } = useI18n();

src/components/ThemeSwitch.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<script setup lang="ts">
2-
import { useI18n } from '../hooks/useI18n';
2+
import { useI18n } from '@/hooks/useI18n';
33
44
const { t } = useI18n();
55

src/composables/useImageCompression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { compress, EImageType } from 'image-conversion';
2+
import { maxSize } from '@/variables/constants';
23

34
export async function useImageCompression(file: File, quality: number = 1): Promise<File> {
4-
const maxSize = 10000000;
55
if (file.size < maxSize) return file; // if below 10 MB, don't do anything
66
const res = await compress(file, {
77
quality,

src/composables/useZipCompression.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import JSZip from 'jszip';
22
import { storeToRefs } from 'pinia';
3-
import { useFileDataStore } from '../stores/fileData';
3+
import { useFileDataStore } from '@/stores/fileData';
44

55
export async function useZipCompression(): Promise<string> {
66
const zip = new JSZip();

src/hooks/useI18n.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { i18n, messages } from '../i18n';
1+
import { i18n, messages } from '@/i18n';
22

33
// inspired by https://stackoverflow.com/questions/58434389/typescript-deep-keyof-of-a-nested-object
44

src/i18n/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ const languageMap = {
2121
const langEntries = Object.entries(languageMap);
2222
const preferredUserLang = navigator.language;
2323

24-
const userLang = langEntries.find((lang) => lang[1].some((langCode) => langCode === preferredUserLang))?.[0] ?? 'English';
24+
const userLang =
25+
langEntries.find((lang) => lang[1].some((langCode) => langCode === preferredUserLang))?.[0] ?? 'English';
2526

2627
const localStorageLang = localStorage.getItem('lang');
2728
const preferredLang = localStorageLang ?? userLang;

src/stores/fileData.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineStore } from 'pinia';
2-
import type { FileObj } from '../types/file';
2+
import type { FileObj } from '@/types/file';
33

44
interface State {
55
files: FileObj[];

0 commit comments

Comments
 (0)