Skip to content

Commit

Permalink
fix(metrics): remove suuid as it is no longer used (#60)
Browse files Browse the repository at this point in the history
  • Loading branch information
izzylys authored Sep 7, 2022
1 parent 4d1333c commit 9aea5dd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 19 deletions.
8 changes: 0 additions & 8 deletions speckle_connector/accounts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ def self.default_account
accts.select { |acc| acc["isDefault"] }[0] || accts[0]
end

def self.get_suuid
dir = _get_speckle_dir
suuid_path = File.join(dir, "suuid")
return unless File.exist?(suuid_path)

File.read(suuid_path)
end

def self._get_speckle_dir
speckle_dir =
case Sketchup.platform
Expand Down
2 changes: 1 addition & 1 deletion speckle_connector/dialog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def self.load_saved_streams

def self.init_local_accounts
puts("Initialisation of Speckle accounts requested by plugin")
@dialog.execute_script("loadAccounts(#{Accounts.load_accounts.to_json}, #{Accounts.get_suuid.to_json})")
@dialog.execute_script("loadAccounts(#{Accounts.load_accounts.to_json})")
end

def self.reload_accounts
Expand Down
14 changes: 6 additions & 8 deletions ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,14 @@ import { bus } from './main'
import userQuery from './graphql/user.gql'
import { onLogin } from './vue-apollo'
global.loadAccounts = function (accounts, suuid) {
console.log('>>> SpeckleSketchup: Loading accounts', accounts, `suuid: ${suuid}`)
global.loadAccounts = function (accounts) {
console.log('>>> SpeckleSketchup: Loading accounts', accounts)
localStorage.setItem('localAccounts', JSON.stringify(accounts))
if (suuid) {
localStorage.setItem('suuid', suuid)
global.setSelectedAccount(accounts.find((acct) => acct['isDefault']))
let uuid = localStorage.getItem('uuid')
if (uuid) {
global.setSelectedAccount(accounts.find((acct) => acct['userInfo']['id'] == uuid))
} else {
global.setSelectedAccount(
accounts.find((acct) => acct['userInfo']['id'] == localStorage.getItem('uuid'))
)
global.setSelectedAccount(accounts.find((acct) => acct['isDefault']))
}
}
Expand Down
1 change: 0 additions & 1 deletion ui/src/graphql/user.gql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ query {
verified
profiles
role
suuid
streams {
totalCount
}
Expand Down
1 change: 0 additions & 1 deletion ui/src/graphql/userById.gql
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,5 @@ query User($id: String!) {
verified
profiles
role
suuid
}
}

0 comments on commit 9aea5dd

Please sign in to comment.