Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

62
Vistas
Tauri JS API dialog and notification modules not doing anything, returning null

I am familiarizing myself with the tauri framework currently by developing a small desktop app. Most of the tauri JS API modules I have been testing have worked so far, except for the dialog and notification modules. When any of the functions from the dialog module are tested, for example open, the promise immediately resolves with a null value, and nothing on the tauri end noticeably occurs (for example, when the open function is called, a file dialog should appear). I haven't altered the generated Rust files at all, and I am using a VueJS SPA on the frontend, which I have been running in a 64-bit Windows 10 environment. Additionally, the tauri.conf.json file has the correct permissions set for the use of these modules.

This is the code where I call the dialog.open function:

import { Options, Vue } from "vue-class-component";
import { open as openDialog } from "@tauri-apps/api/dialog";

@Options({
  components: {
    ... some vue components ...
  },
})
export default class Freeze extends Vue {
  selectedFilepaths: string[] = [];

  async selectFile(){
    const pathName: string = await openDialog({
      defaultPath: ".",
      multiple: false
    }) as string;
    this.selectedFilepaths.push(pathName);
  }
}

Any help would be much appreciated :)

7 months ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Turns out, the culprit was defaultPath field.

You have to provide a valid path there (or not use it at all), otherwise it will fail silently.

7 months ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.