Skip to content

Commit

Permalink
[v2.0.0-alpha.4] Merge pull request #17 from bridge-core/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
solvedDev authored Feb 15, 2021
2 parents 35b4f0d + 774cb9e commit a0fd0a8
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion data/preset/entity/bee/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
],
[
"textureNectar.png",
"RP/textures/entity/{{IDENTIFIER}}.png",
"RP/textures/entity/{{IDENTIFIER}}_nectar.png",
{ "inject": ["IDENTIFIER"] }
]
],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "2.0.0-alpha.3",
"version": "2.0.0-alpha.4",
"private": true,
"scripts": {
"build:data": "node ./scripts/build.mjs",
Expand Down
2 changes: 1 addition & 1 deletion src/appVersion.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"version": "2.0.0-alpha.3"
"version": "2.0.0-alpha.4"
}
16 changes: 13 additions & 3 deletions src/components/Projects/CreateProject/CreateProject.vue
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@
<v-btn
color="primary"
:disabled="!currentWindow.hasRequiredData"
:loading="
isCreatingProject || !isCompilerReady || !isPackIndexerReady
"
:loading="shouldLoad"
@click="createProject"
>
<v-icon class="pr-2">mdi-plus</v-icon>
Expand Down Expand Up @@ -139,6 +137,18 @@ export default {
data() {
return this.currentWindow
},
computed: {
shouldLoad() {
// If this is the first project, only show a spinner while creating the spinner
if (this.isFirstProject) return this.isCreatingProject
// Otherwise check that the compiler & pack indexer are done too
return (
this.isCreatingProject ||
!this.isCompilerReady ||
!this.isPackIndexerReady
)
},
},
methods: {
close() {
this.currentWindow.close()
Expand Down
9 changes: 4 additions & 5 deletions src/components/Windows/Project/CreatePreset/CreatePreset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -229,19 +229,18 @@ export class CreatePresetWindow extends BaseWindow {

let destFileText: string
try {
destFileText = this.transformString(
await (await fs.readFile(fullDestPath)).text(),
inject
)
destFileText = await (await fs.readFile(fullDestPath)).text()
} catch {
destFileText = ''
}

const outputFileText = this.transformString(fileText, inject)

await fs.writeFile(
fullDestPath,
`${destFileText}${
destFileText !== '' ? '\n' : ''
}${fileText}`
}${outputFileText}`
)
}
})
Expand Down

0 comments on commit a0fd0a8

Please sign in to comment.