Rotonde / rotonde-client

Rotonde Base Client
https://client-neauoire.hashbase.io/
MIT License
227 stars 49 forks source link

Unable to reset rotonde profile #78

Closed hermes-diactoros closed 6 years ago

hermes-diactoros commented 6 years ago

Following the steps described in this post, I get stuck when trying to reset my rotonde profile. I click on the command text box and press "Ctrl+Shift+Backspace", and nothing happens. After checking the console for errors, I see the following:

rotonde.js:106 Uncaught (in promise) TypeError: Cannot read property 'archive' of null at Rotonde.reset_with_name (rotonde.js:106) at Rotonde.reset (rotonde.js:100) at HTMLTextAreaElement.Operator.key_down (operator.js:269) Rotonde.reset_with_name @ rotonde.js:106 Rotonde.reset @ rotonde.js:100 Operator.key_down @ operator.js:269

Seems like the `archive' variable is null for some reason. Any ideas?

Using Beaker Version: 0.7.6 Electron: 1.7.4 - Chromium: 58.0.3029.110 - Node: 7.9.0.

ghost commented 6 years ago

I have exactly the same problem. It looks like this.portal is set to null so this.portal.archive and this.portal.save (after trying to set archive by hand) results an error.

My observations:

// rotonde.js
this.reset_with_name = async function()
{
  var archive = new DatArchive(window.location.toString()) // archive var is never used
  var portal_str = await r.portal.archive.readFile('/dat.json',{timeout: 1000}); // ``portal`` is defined in ``this.home.portal`` so ``r.home.portal.archive`` should be used or ``new Portal()`` should be created in ``this.portal``
  var name = JSON.parse(portal_str).title.replace(/\W/g, '');
  this.portal.data = {name: name,desc: "new_desc",port:[],feed:[],site:"",dat:""} // i'm not sure about that
  this.portal.save(); // save method exist in ``home`` not in ``portal``
}
neauoire commented 6 years ago

Fixed :) sorry about that.