Skip to content

Commit 8365141

Browse files
committed
fix: don't throw error when livesyncing css
todo: disable full reload with hooks, and clone root vm + navigate to show changes fixes #63
1 parent 65f443b commit 8365141

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

Diff for: platform/nativescript/framework.js

+21-2
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,7 @@ console.keys = function(object) {
3939
application.on(application.exitEvent, () => {
4040
const frame = topmost()
4141
if (frame) {
42-
console.log(frame)
4342
frame.eachChildView(child => {
44-
console.log('found child')
4543
const vm = child[VUE_VM_REF]
4644

4745
if (vm) {
@@ -52,4 +50,25 @@ application.on(application.exitEvent, () => {
5250
}
5351
})
5452

53+
global.__onLiveSyncCore = () => {
54+
const frame = topmost()
55+
if (frame) {
56+
if (frame.currentPage && frame.currentPage.modal) {
57+
frame.currentPage.modal.closeModal()
58+
}
59+
// Todo: make sure that the before-livesync hook is installed, because otherwise the page will always get reloaded.
60+
// const currentEntry = frame._currentEntry && frame._currentEntry.entry
61+
// if (currentEntry) {
62+
63+
// const newEntry = {
64+
// animated: false,
65+
// clearHistory: true,
66+
// create: () => { } ,
67+
// backstackVisible: currentEntry.backstackVisible
68+
// }
69+
// frame.navigate(newEntry)
70+
// }
71+
}
72+
}
73+
5574
export default Vue
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = function($usbLiveSyncService) {
2+
$usbLiveSyncService.forceExecuteFullSync = false
3+
}

Diff for: samples/app/app-with-v-template.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ new Vue({
3535
<list-view for="line in items">
3636
<v-template>
3737
<StackLayout style="padding: 50;">
38-
<Label :text="line" style="color: blue;"/>
38+
<Label :text="line" class="even"/>
3939
</StackLayout>
4040
</v-template>
4141
<v-template if="line.length == 2">
@@ -45,7 +45,7 @@ new Vue({
4545
</v-template>
4646
<v-template if="$odd">
4747
<StackLayout style="padding: 50;">
48-
<Label :text="line" style="color: red;"/>
48+
<Label :text="line" class="odd"/>
4949
</StackLayout>
5050
</v-template>
5151
</list-view>

0 commit comments

Comments
 (0)