Commit a0c696b 1 parent 781146b commit a0c696b Copy full SHA for a0c696b
File tree 4 files changed +32
-18
lines changed
4 files changed +32
-18
lines changed Original file line number Diff line number Diff line change 11
11
<div v-else-if =" error != null" >
12
12
{{ _t(error.userMessage) }}
13
13
</div >
14
- <EditorContextProvider v-else-if =" project != null" :project =" project" :user-info =" userStore.userInfo" >
14
+ <EditorContextProvider
15
+ v-else-if =" project != null"
16
+ :project =" project"
17
+ :user-info =" userStore.userInfo"
18
+ >
15
19
<ProjectEditor />
16
20
</EditorContextProvider >
17
21
<div v-else >TODO</div >
@@ -56,7 +60,11 @@ const projectName = computed(
56
60
() => router .currentRoute .value .params .projectName as string | undefined
57
61
)
58
62
59
- const { data : project, isFetching : isLoading, error } = useQuery (
63
+ const {
64
+ data : project,
65
+ isFetching : isLoading,
66
+ error
67
+ } = useQuery (
60
68
async () => {
61
69
if (userStore .userInfo == null ) return null
62
70
if (projectName .value == null ) return null
Original file line number Diff line number Diff line change @@ -65,13 +65,15 @@ export class Sound {
65
65
66
66
static async loadAll ( files : Files ) {
67
67
const soundNames = listDirs ( files , soundAssetPath )
68
- const sounds = ( await Promise . all (
69
- soundNames . map ( async ( soundName ) => {
70
- const sound = await Sound . load ( soundName , files )
71
- if ( sound == null ) console . warn ( 'failed to load sound:' , soundName )
72
- return sound
73
- } )
74
- ) ) . filter ( s => ! ! s ) as Sound [ ]
68
+ const sounds = (
69
+ await Promise . all (
70
+ soundNames . map ( async ( soundName ) => {
71
+ const sound = await Sound . load ( soundName , files )
72
+ if ( sound == null ) console . warn ( 'failed to load sound:' , soundName )
73
+ return sound
74
+ } )
75
+ )
76
+ ) . filter ( ( s ) => ! ! s ) as Sound [ ]
75
77
return sounds
76
78
}
77
79
Original file line number Diff line number Diff line change @@ -161,13 +161,15 @@ export class Sprite extends Disposble {
161
161
162
162
static async loadAll ( files : Files ) {
163
163
const spriteNames = listDirs ( files , spriteAssetPath )
164
- const sprites = ( await Promise . all (
165
- spriteNames . map ( async ( spriteName ) => {
166
- const sprite = await Sprite . load ( spriteName , files )
167
- if ( sprite == null ) console . warn ( 'failed to load sprite:' , spriteName )
168
- return sprite
169
- } )
170
- ) ) . filter ( s => ! ! s ) as Sprite [ ]
164
+ const sprites = (
165
+ await Promise . all (
166
+ spriteNames . map ( async ( spriteName ) => {
167
+ const sprite = await Sprite . load ( spriteName , files )
168
+ if ( sprite == null ) console . warn ( 'failed to load sprite:' , spriteName )
169
+ return sprite
170
+ } )
171
+ )
172
+ ) . filter ( ( s ) => ! ! s ) as Sprite [ ]
171
173
return sprites
172
174
}
173
175
Original file line number Diff line number Diff line change @@ -32,7 +32,9 @@ describe('stripExt', () => {
32
32
} )
33
33
it ( 'should work well with url' , ( ) => {
34
34
expect ( stripExt ( 'https://test.com/abc.txt' ) ) . toBe ( 'https://test.com/abc' )
35
- expect ( stripExt ( 'https://test.com/foo/%E4%B8%AD%E6%96%87.png' ) ) . toBe ( 'https://test.com/foo/%E4%B8%AD%E6%96%87' )
35
+ expect ( stripExt ( 'https://test.com/foo/%E4%B8%AD%E6%96%87.png' ) ) . toBe (
36
+ 'https://test.com/foo/%E4%B8%AD%E6%96%87'
37
+ )
36
38
} )
37
39
it ( 'should work well with no ext' , ( ) => {
38
40
expect ( stripExt ( 'abc' ) ) . toBe ( 'abc' )
@@ -44,4 +46,4 @@ describe('stripExt', () => {
44
46
expect ( stripExt ( 'foo/.cache/abc.d.ts' ) ) . toBe ( 'foo/.cache/abc.d' )
45
47
expect ( stripExt ( '/foo/bar/.gitignore' ) ) . toBe ( '/foo/bar/.gitignore' )
46
48
} )
47
- } )
49
+ } )
You can’t perform that action at this time.
0 commit comments