Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Botão abrir arquivo de backup #7

Open
bitts opened this issue Mar 29, 2021 · 1 comment
Open

Botão abrir arquivo de backup #7

bitts opened this issue Mar 29, 2021 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@bitts
Copy link
Owner

bitts commented Mar 29, 2021

Existe um problema ao utilizar new FileReader() ao selecionar o arquivo para restore uma segunda vez.
Para isso atualmente o sistema, após abrir um arquivo a primeira vez, desaparece! Reaparecendo somente quando é recarregado a interface de administração (mascarando assim este bug).

Para colocar o botão no menu do topo é necessário concertar este bug.

Sugestões atuais:

  • após carregar o arquivo de backup destruir e recriar botão e sua ação;
  • estudar melhor metodos de callback do FileReader;
  • levar para backend e tratar com php a abertura do arquivo, retornando seu conteudo para interface;
@bitts
Copy link
Owner Author

bitts commented Mar 29, 2021

Atualmente utilizando de:

  var reader = new FileReader();
  var txt = reader.readAsText(file);

  reader.onload = function() {
      let json = reader.result;
      $('textarea.pagtesourojson').val(json);
      populate_pagtesouro(json)
      URL.revokeObjectURL(reader)
 }

@bitts bitts self-assigned this Mar 29, 2021
@bitts bitts added the bug Something isn't working label Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant