Skip to content

Commit

Permalink
fix some bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
A1Gard committed Jun 13, 2021
1 parent 662acc3 commit fef0a52
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "anubias",
"version": "0.6.0",
"version": "0.6.1",
"private": false,
"description": "anubias desktop application",
"author": {
Expand Down
8 changes: 8 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,14 @@ export default {
// go to verify
self.$router.push('/projectLoaded');
});
window.api.receive('build-success', (data) => {
if (data && window.ide.isDebuging) {
window.alertify.success('Hot reload! 🔥');
window.api.send("update-project", {});
}
});
// get message receive command send by electron
window.api.receive("message", (data) => {
switch (data.type) {
Expand Down
6 changes: 4 additions & 2 deletions src/assets/js/winVars.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
window.ide = {
majorVersion: 0,
minorVersion: 6,
patchVersion: 0,
patchVersion: 1,
version:function () {
return this.majorVersion + '.' + this.minorVersion + '.' + this.patchVersion;
}
},
isDebuging: false,
isInitReload: false,
};
/**
* sample application date
Expand Down
22 changes: 8 additions & 14 deletions src/components/elements/AppMenuElement.vue
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default {
data: function () {
return {
appData: window.appData,
startDebug: false,
startDebug: window.ide.isDebuging,
}
},
mounted() {
Expand Down Expand Up @@ -170,22 +170,15 @@ export default {

});

window.api.receive('build-success', (data) => {
if(data && self.startDebug){
window.alertify.success('Hot reload! 🔥');
window.api.send("update-project", {});
}
});

}, methods: {
hotReload:function () {
if (!this.startDebug){
hotReload: function () {
if (!this.startDebug) {
window.alertify.warning('Hot reload failed');
}else{
} else {
this.save();
let data = {
isUpdate: true,
command: './anubias-engine build ' + window.project.file ,
command: './anubias-engine build ' + window.project.file,
}
window.api.send("command", data);
}
Expand All @@ -203,10 +196,11 @@ export default {
return false;
}
this.$parent.TerminalShow();
this.startDebug= true;
this.startDebug = true;
window.ide.isDebuging = true;
let data = {
isDebug: true,
command: './anubias-engine build ' + window.project.file +' && cd build && flutter run' ,
command: './anubias-engine build ' + window.project.file + ' && cd build && flutter run',
}
window.api.send("command", data);
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/elements/Simulator.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div v-if="type === 'appbar'">
<appbar :properties="properties" :scale="scale" :page="page"></appbar>
</div>
<div v-if="type === 'text'">
<div v-if="type === 'text'" :style="properties.align == 'null'? 'text-align:'+page.align:''">
<txt :properties="properties" :scale="scale" :page="page"></txt>
</div>
<div v-if="type === 'icon'">
Expand Down
2 changes: 1 addition & 1 deletion src/components/pages/ProjectPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@

<script>
import titlec from '../elements/TitleElement';

// import {fnc} from '@/assets/js/functions';
export default {
name: "ProjectPage",
data: function () {
Expand Down

0 comments on commit fef0a52

Please sign in to comment.