connect auth works, now for settings sync

This commit is contained in:
child_duckling 2022-04-16 23:59:30 -07:00
parent 4e8a160600
commit a844903dff
7 changed files with 51 additions and 22 deletions

View file

@ -4256,6 +4256,9 @@ const app = new Vue({
document.getElementById('settings.option.general.updateCider.check').innerHTML = app.getLz('term.check')
})
},
authCC(){
ipcRenderer.send('cc-auth')
}
}
})

View file

@ -1,14 +1,17 @@
<template v-if="page == 'connect-linked'">
<div style="display:flex;width:100%;height:100%">
<webview id="foo" :src="https://connect.cidercollective.dev/linked.html" nodeintegration="true" style="display:inline-flex; width:100%;"></webview>
<script type="text/x-template" id="connected">
<div style="display:flex;width:100%;height:100%;padding-top: var(--navigationBarHeight);position:absolute;top:0;left:0;">
<webview id="foo" src="https://cider.sh" style="display:inline-flex; width:100%;"></webview>
</div>
</template>
</script>
<script>
Vue.component('connect-linked', {
template: '#connect-linked',
mounted() {
document.querySelector("#foo").addEventListener("dom-ready", ()=>{
Vue.component('connected', {
template: '#connected',
async mounted() {
ipcRenderer.send('get-connected-url')
ipcRenderer.on('send-connected-url', (event, url) => {
this.url = url
app.webview.src = url
document.getElementById('foo').src = url;
})
},
methods: {

View file

@ -982,9 +982,17 @@
<div class="md-option-header">
<span>{{$root.getLz('settings.header.connect')}}</span>
</div>
<div class="settings-option-body">
<webview url="https://connect.cidercollective.dev/app-redirect.html"></webview>
<div class="md-option-line update-check">
<div class="md-option-segment">
{{$root.getLz('settings.option.connect.link_account')}}
</div>
<div class="md-option-segment md-option-segment_auto">
<button class="md-btn" id='settings.option.general.updateCider.check' @click="authCC()">
{{$root.getLz('term.connect')}}
</button>
</div>
{{ app.cfg.connectUser}}
</div>
</div>
</div>
</b-tab>
@ -1224,7 +1232,10 @@
ipcRenderer.send('relaunchApp', '');
}
});
}
},
authCC() {
ipcRenderer.send('cc-auth')
},
}
})
</script>

View file

@ -1,6 +1,5 @@
<template v-if="page == 'webview'">
<div style="display:flex;width:100%;height:100%">
<<webview id="foo" :src="webview.url" nodeintegration="true" style="display:inline-flex; width:100%;"></webview>
<webview id="foo" :src="webview.url" nodeintegration="true" style="display:inline-flex; width:100%;"></webview>
</div>
</template>