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
const getDownloadItems = (state) => { | |
const isPrivate = state.get('currentWindow') | |
.get('frames') | |
.get('0') | |
.get('isPrivate') | |
if (!isPrivate) { | |
if (!state || !state.get('downloads')) { | |
return Immutable.List() | |
} |
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
const getDownloadItems = (state) => { | |
const currentWindow = state.get('currentWindow') | |
const tabId = frameStateUtil.getActiveFrameTabId(state) | |
const frameKey = frameStateUtil.getFrameKeyByTabId(currentWindow, tabId) | |
const isPrivate = privateState.isPrivateTab(state, frameKey) | |
if (!isPrivate) { | |
if (!state || !state.get('downloads')) { | |
return Immutable.List() |
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
function getActiveFrameTabId (state) { | |
const activeFrame = getActiveFrame(state) | |
return activeFrame && activeFrame.get('tabId') | |
} |
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
module.exports.isPrivateTab = (state, frameKey) => { | |
const frame = frameStateUtil.getFrameByKey(state, frameKey) | |
if (frame == null) { | |
return false | |
} | |
return !!frame.get('isPrivate') | |
} |
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
const getDownloadItems = (state) => { | |
..... | |
} | |
mergeProps (state, ownProps) { | |
...... | |
} | |
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
mergeProps (state, ownProps) { | |
const currentWindow = state.get('currentWindow') | |
const tabId = ownProps.tabId | |
const frameKey = frameStateUtil.getFrameKeyByTabId(currentWindow, tabId) | |
const props = {} | |
props.isPinned = tabState.isTabPinned(state, tabId) | |
props.showTabTitle = titleState.showTabTitle(currentWindow, frameKey) | |
.... |
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
module.exports.showTabTitle = (state, frameKey) => { | |
const frame = frameStateUtil.getFrameByKey(state, frameKey) | |
if (frame == null) { | |
return false | |
} | |
const isNewTabPage = frameStateUtil.frameLocationMatch(frame, 'about:newtab') | |
const isActive = frameStateUtil.isFrameKeyActive(state, frameKey) | |
const isPartition = partitionState.isPartitionTab(state, frameKey) |
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
.... | |
... | |
.. | |
. | |
onShowDownloads () { | |
appActions.createTabRequested({ | |
url: 'about:downloads' | |
}) | |
windowActions.setDownloadsToolbarVisible(false) | |
} |
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
props.downloads = downloadUtil.getDownloadItems(state) || Immutable.List() | |
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
const getDownloadItems = (state) => { | |
if (!state || !state.get('downloads')) { | |
return Immutable.List() | |
} | |
const downloadsSize = state.get('downloads').size | |
const downloadItemWidth = domUtil.getStyleConstants('download-item-width') | |
const downloadItemMargin = domUtil.getStyleConstants('download-item-margin') | |
const downloadBarPadding = domUtil.getStyleConstants('download-bar-padding') | |
const downloadBarButtons = domUtil.getStyleConstants('download-bar-buttons') |
NewerOlder