#windows

20 messages · Page 1 of 1 (latest)

molten herald
#

where is renderer code?

haughty geode
#
<script lang="ts">
import { ipcRenderer} from "electron"
import { useRoute } from "vue-router";
let route = useRoute();
ipcRenderer.on("OutputDemo", async (event, data) => {
  console.log(data);
  // alert("ประกาศ")
});

import { mapActions } from 'vuex';
export default {
  data() {
    return {
      username: '' as string,
      password: '' as string,
    }
  },
  mounted() {

  },
  methods: {
    discord() {
      ipcRenderer.send("discord")
    },
    test() {
      ipcRenderer.on('on-msg', (event, data) => {
      console.log(data)
    })
      // ipcRenderer.send('test')

    },
  }
}
</script>
molten herald
#

and what window it is?

haughty geode
molten herald
#

this is main process code

haughty geode
#

I recreated the window to log in.

molten herald
#

so you sending message to closed window?

haughty geode
#

yes

molten herald
#

how it is supposed to read your message then?

haughty geode
#

res for authWindow

molten herald
#

how it is supposed to read your message then?

haughty geode
#

And I'm sending it back to the other page of the HTML side.

molten herald
#

you sending to authWindow.webContents.send('on-msg', token);

haughty geode
#

OH So I have to send it to win

#

@molten herald Then how do I wait to receive HTML?

#
`ipcmain`
authWindow.webContents.on('will-redirect', async (event, newUrl) => {
        console.log("xx", newUrl);
        const code = newUrl.split("?token=")[1];
        const token = await oauth.getUser(code);
        console.log(token);

        win?.webContents.send('on-msg', token)

        // authWindow.close();

    });
`html`
ipcRenderer.on('on-msg', (event, data) => {
        console.log(data)
      })
molten herald
#

what html?

haughty geode
#

How do I wait to receive it?


test() {
      ipcRenderer.on('on-msg', (event, data) => {
        console.log(data)
      })
},

molten herald
#

receive where?