Skip to content

Commit

Permalink
Fix logout crash if Solid profile is already in list of sources
Browse files Browse the repository at this point in the history
Closes #150
  • Loading branch information
mvanbrab authored Jul 14, 2023
1 parent ab82f79 commit 35866d2
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/ldf-client-ui.js
Original file line number Diff line number Diff line change
Expand Up @@ -319,14 +319,16 @@ if (typeof global.process === 'undefined')
self._setWebIdName();
$webid.show();

// Add profile to datasources
self._setOption('datasources', [
{
name: 'My Solid Profile',
url: $solidSession.info.webId,
},
...self.options.datasources,
]);
// Add profile to datasources, unless it's already in
if (!self.options.datasources.find(ds => ds.url === $solidSession.info.webId)) {
self._setOption('datasources', [
{
name: 'My Solid Profile',
url: $solidSession.info.webId,
},
...self.options.datasources,
]);
}

// Request the user's name from the worker
this._queryWorker.postMessage({
Expand Down

0 comments on commit 35866d2

Please sign in to comment.