netizenorg / netnet.studio

netnet.studio is a hypermedia higherEd cyberspace for fully realizing the Web’s creative potential.
https://netnet.studio
GNU General Public License v3.0
30 stars 8 forks source link

Issue #237: error loading older examples #246

Closed Cthomp7 closed 9 months ago

Cthomp7 commented 10 months ago

Error was coming from line 342 this._text.code = null. It was unhappy about it being null, so I set it to an empty string. #237

Also after choosing yes!, I have it hide the convo. The ' e.goTo('loaded-json')' wasn't referencing anything.

nbriz commented 9 months ago

@Cthomp7 this looks good (functionally speaking), but there are linting issues in the convo file:

here's a version that should pass the linter u can copy+paste ;)

/* global NNE */
window.CONVOS['demo-example-maker'] = (self) => {
  return [{
    id: 'before-loading-json',
    content: 'Looks like you want to upload a new example. Are you sure you want to overwrite your current session?',
    options: {
      'yes!': (e) => {
        self._uploadJSON(self.loaded)
        e.hide()
      },
      'load it in a new tab': (e) => {
        const l = window.location
        const str = JSON.stringify(self.loaded)
        const url = `${l.protocol}//${l.host}/?dem=true#example/${NNE._encode(str)}`
        window.open(url, '_blank')
      },
      'oops, no thank you': (e) => e.hide()
    }
  }]
}
Cthomp7 commented 9 months ago

@nbriz Copied and pasted :) Thanks a lot! I have a sticky note that says "make sure your code is up to STANDARD!" Need to get better at remembering that haha

nbriz commented 9 months ago

@Cthomp7 i'm still getting the following linting errors:

i'm guessing ur editor might be auto-formatting things when u save, so to avoid too much back/fourth i'm gonna merge this && then just clean it up in one of my next updates :)