Skip to content

Instantly share code, notes, and snippets.

@kdembler
Last active June 25, 2021 14:39
Show Gist options
  • Save kdembler/a77b32bc1ee7b8898e3d07cf34e26d26 to your computer and use it in GitHub Desktop.
Save kdembler/a77b32bc1ee7b8898e3d07cf34e26d26 to your computer and use it in GitHub Desktop.

Testing dev Atlas

Thanks for your interest in helping test the beta version of Atlas. If you get lost at any point feel free to reach out to me for help on Discord.

Steps to take

  1. Go to https://play.joystream.org and open the browser console. (F12 in most browsers)
  2. Copy this 👇🏻 and paste it into console. Hit enter. This should result in .json file being downloaded. This contains all your local Atlas state (nothing confidential)
const exportStorage = () => {
  const storageKeys = Object.keys(window.localStorage)
  const storage = storageKeys.reduce((acc, key) => {
    const rawValue = window.localStorage.getItem(key)
    acc[key] = JSON.parse(rawValue)
    return acc
  }, {})
  const jsonStorage = JSON.stringify(storage)

  const linkElement = document.createElement('a');
  linkElement.setAttribute('href', 'data:application/json;charset=utf-8,' + encodeURIComponent(jsonStorage));
  linkElement.setAttribute('download', 'atlas-export.json');
  linkElement.click()
}
exportStorage()
  1. Go to https://atlas-dev.netlify.app/admin. Select production from the dropdown and refresh the page. You can go back to the home page and should see same videos as on https://play.joystream.org
  2. Open browser console once again and paste 👇🏻 in the console, hit enter. This should open a file prompt. Select the previously downloaded .json file
const importStorage = () => {
  const inputElement = document.createElement('input')
  inputElement.setAttribute('type', 'file')
  inputElement.click()
  const handleChange = async (e) => {
    const file = e.target.files[0]
    const fileText = await file.text()
    const storage = JSON.parse(fileText)
    Object.keys(storage).forEach(key => {
      window.localStorage.setItem(key, JSON.stringify(storage[key]))
    })
  }
  inputElement.addEventListener('change', handleChange)
}
importStorage()
  1. Refresh the page
  2. Open the console again and make sure there are no errors there. If there are, note them down
  3. Feel free to test the app. What I'm most interested in is 6. and also visiting Studio and browsing around. Take a look at uploads and see if everything looks good there. Note down anything suspicious/unexpected.
  4. Try to break the app :P
  5. Please report back with the result (either some kind of report or just info that everything is working)
  6. Thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment