Skip to content

Commit

Permalink
Converts BraveryPanel into redux component
Browse files Browse the repository at this point in the history
Resolves brave#9454

Auditors: @bsclifton @bridiver

Test Plan:
  • Loading branch information
NejcZdovc committed Jun 14, 2017
1 parent 915e13e commit 7cc456c
Show file tree
Hide file tree
Showing 3 changed files with 266 additions and 250 deletions.
34 changes: 34 additions & 0 deletions app/common/lib/braveryPanelUtil.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */

const Immutable = require('immutable')

// Utils
const urlParse = require('../urlParse')

const getDisplayHost = (lastCommittedURL) => {
const parsedUrl = urlParse(lastCommittedURL)
if (parsedUrl.protocol === 'https:' || parsedUrl.protocol === 'http:') {
return parsedUrl.host
}

return lastCommittedURL
}

const getRedirectedResourcesSet = (redirectedResources) => {
let result = new Immutable.List()
if (redirectedResources) {
redirectedResources.forEach((urls) => {
if (urls) {
result = result.push(urls)
}
})
}
return result
}

module.exports = {
getDisplayHost,
getRedirectedResourcesSet
}
Loading

0 comments on commit 7cc456c

Please sign in to comment.