-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Co-authored-by: sanjay12345 <sanjaymj824@gmail.com> Co-authored-by: Maisnam Raju Singh <85172229+maisnamrajusingh@users.noreply.github.com> Co-authored-by: maisnamrajusingh <raju.s@demansol.com>
- Loading branch information
1 parent
f2b297d
commit f515bf4
Showing
3 changed files
with
24 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,19 @@ | ||
import {getConfig} from 'mattermost-redux/selectors/entities/general'; | ||
|
||
import {id as pluginId} from '../manifest'; | ||
|
||
const getPluginState = (state) => state['plugins-' + pluginId] || {}; | ||
const getPluginState = (state) => state[`plugins-${pluginId}`] || {}; | ||
|
||
export const getPluginServerRoute = (state) => { | ||
const config = getConfig(state); | ||
|
||
const getAuthenticationResult = (state) => getPluginState(state).authenticationResult; | ||
let basePath = ''; | ||
if (config?.SiteURL) { | ||
basePath = new URL(config.SiteURL).pathname; | ||
basePath.replace(/\/$/, ''); | ||
} | ||
|
||
export default { | ||
getAuthenticationResult, | ||
return basePath; | ||
}; | ||
|
||
export const getAuthenticationResult = (state) => getPluginState(state).authenticationResult; |