2019-03-05 07:24:03 +01:00
|
|
|
import { hot } from 'react-hot-loader/root';
|
2017-12-21 22:08:54 +01:00
|
|
|
import { connect } from 'react-redux';
|
2021-12-06 15:38:26 +01:00
|
|
|
import { selectGetSyncErrorMessage, selectSyncFatalError, selectSyncIsLocked } from 'redux/selectors/sync';
|
2020-06-15 22:33:03 +02:00
|
|
|
import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user';
|
|
|
|
import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/selectors/user';
|
|
|
|
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
2021-10-17 10:36:14 +02:00
|
|
|
import { doFetchChannelListMine, doFetchCollectionListMine, doResolveUris } from 'redux/actions/claims';
|
2021-12-06 15:38:26 +01:00
|
|
|
import { selectMyChannelClaimIds } from 'redux/selectors/claims';
|
2021-06-09 21:20:19 +02:00
|
|
|
import { selectSubscriptions } from 'redux/selectors/subscriptions';
|
2021-12-06 15:38:26 +01:00
|
|
|
import { selectLanguage, selectLoadedLanguages, selectThemePath } from 'redux/selectors/settings';
|
2021-02-09 17:05:56 +01:00
|
|
|
import {
|
|
|
|
selectIsUpgradeAvailable,
|
|
|
|
selectAutoUpdateDownloaded,
|
|
|
|
selectModal,
|
2021-12-06 15:38:26 +01:00
|
|
|
selectActiveChannelId,
|
2021-10-27 17:07:06 +02:00
|
|
|
selectIsReloadRequired,
|
2021-02-09 17:05:56 +01:00
|
|
|
} from 'redux/selectors/app';
|
Support resume-able upload via tus (#186)
* Publish button: use spinner instead of "Publishing..."
Looks better, plus the preview could take a while sometimes.
* Refactor `doPublish`. No functional change
This is to allow `doPublish` to accept a custom payload as an input (for resuming uploads), instead of always resolving it from the redux data.
* Add doPublishResume
* Support resume-able upload via tus
## Issue
38 Handle resumable file upload
## Notes
Since we can't serialize a File object, we'll need to the user to re-select the file to resume.
* Exclude "modified date" for Firefox/Android
## Issue
It appears that the modification date of the Android file changes when selected, so that file was deemed "different" when trying to resume upload.
## Change
Exclude modification date for now. Let's assume a smart user.
* Move 'currentUploads' to 'publish' reducer
`publish` is currently rehydrated, so we can ride on that and don't need to store the `currentUploads` in `localStorage` for persistence. This would allow us to store Markdown Post data too, as `localStorage` has a 5MB limit per app.
We could have also made `webReducer` rehydrate, but in this repo, there is no need to split it to another reducer. It also makes more sense to be part of publish anyway (at least to me).
This change is mostly moving items between files, with the exception of
1. An additional REHYDRATE in the publish reducer to clean up the tusUploader.
2. Not clearing `currentUploads` in CLEAR_PUBLISH.
* Restore v1 code for livestream replay, etc.
v2 (tus) does not handle `remote_url`, so the app still needs v1 for that. Since we'll still have v1 code, use v1 for previews as well.
2021-11-10 19:16:16 +01:00
|
|
|
import { selectUploadCount } from 'redux/selectors/publish';
|
2021-11-15 04:28:30 +01:00
|
|
|
import { doSetLanguage } from 'redux/actions/settings';
|
2021-01-21 20:50:51 +01:00
|
|
|
import { doSyncLoop } from 'redux/actions/sync';
|
2021-11-15 04:28:30 +01:00
|
|
|
import { doDownloadUpgradeRequested, doSignIn, doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
2021-06-04 08:43:36 +02:00
|
|
|
import { doFetchModBlockedList, doFetchCommentModAmIList } from 'redux/actions/comments';
|
2017-12-21 22:08:54 +01:00
|
|
|
import App from './view';
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2021-03-03 19:50:16 +01:00
|
|
|
const select = (state) => ({
|
2017-07-28 03:13:12 +02:00
|
|
|
user: selectUser(state),
|
2020-01-14 21:44:07 +01:00
|
|
|
accessToken: selectAccessToken(state),
|
2018-10-19 17:27:14 +02:00
|
|
|
theme: selectThemePath(state),
|
2020-11-20 14:21:31 +01:00
|
|
|
language: selectLanguage(state),
|
2019-11-08 21:51:42 +01:00
|
|
|
languages: selectLoadedLanguages(state),
|
2019-09-23 03:56:43 +02:00
|
|
|
autoUpdateDownloaded: selectAutoUpdateDownloaded(state),
|
|
|
|
isUpgradeAvailable: selectIsUpgradeAvailable(state),
|
2021-10-27 17:07:06 +02:00
|
|
|
isReloadRequired: selectIsReloadRequired(state),
|
2019-10-22 19:57:32 +02:00
|
|
|
syncError: selectGetSyncErrorMessage(state),
|
2021-12-06 15:38:26 +01:00
|
|
|
syncIsLocked: selectSyncIsLocked(state),
|
2019-10-11 02:37:18 +02:00
|
|
|
uploadCount: selectUploadCount(state),
|
2020-01-14 21:44:07 +01:00
|
|
|
rewards: selectUnclaimedRewards(state),
|
2020-03-12 02:43:52 +01:00
|
|
|
isAuthenticated: selectUserVerifiedEmail(state),
|
2020-09-18 19:26:00 +02:00
|
|
|
currentModal: selectModal(state),
|
2020-11-12 18:38:28 +01:00
|
|
|
syncFatalError: selectSyncFatalError(state),
|
2021-12-06 15:38:26 +01:00
|
|
|
activeChannelId: selectActiveChannelId(state),
|
|
|
|
myChannelClaimIds: selectMyChannelClaimIds(state),
|
2021-06-09 21:20:19 +02:00
|
|
|
subscriptions: selectSubscriptions(state),
|
2017-07-28 03:13:12 +02:00
|
|
|
});
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2021-03-03 19:50:16 +01:00
|
|
|
const perform = (dispatch) => ({
|
2019-08-06 18:53:59 +02:00
|
|
|
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
2019-09-26 18:28:08 +02:00
|
|
|
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
wip
wip
wip - everything but publish, autoplay, and styling
collection publishing
add channel to collection publish
cleanup
wip
bump
clear mass add after success
move collection item management controls
redirect replace to published collection id
bump
playlist selector on create
bump
use new collection add ui element
bump
wip
gitignore
add content json
wip
bump
context add to playlist
basic collections page style pass wip
wip: edits, buttons, styles...
change fileAuthor to claimAuthor
update, pending bugfixes, delete modal progress, collection header, other bugfixes
bump
cleaning
show page bugfix
builtin collection headers
no playlists, no grid title
wip
style tweaks
use normal looking claim previews for collection tiles
add collection changes
style library previews
collection menulist for delete/view on library
delete modal works for unpublished
rearrange collection publish tabs
clean up collection publishing and items
show on odysee
begin collectoin edit header and css renaming
better thumbnails
bump
fix collection publish redirect
view collection in menu does something
copy and thumbs
list previews, pending, context menus, list page
enter to add collection, lists page empty state
playable lists only, delete feature, bump
put fileListDownloaded back
better collection titles
improve collection claim details
fix horiz more icon
fix up channel page
style, copy, bump
refactor preview overlay properties,
fix reposts showing as floppydisk
add watch later toast,
small overlay properties on wunderbar results,
fix collection actions buttons
bump
cleanup
cleaning, refactoring
bump
preview thumb styling, cleanup
support discover page lists search
sync, bump
bump, fix sync more
enforce builtin order for now
new lists page empty state
try to indicate unpublished edits in lists
bump
fix autoplay and linting
consts, fix autoplay
bugs
fixes
cleanup
fix, bump
lists experimental ui, fixes
refactor listIndex out
hack in collection fallback thumb
bump
2021-02-06 08:03:51 +01:00
|
|
|
fetchCollectionListMine: () => dispatch(doFetchCollectionListMine()),
|
2021-03-03 19:50:16 +01:00
|
|
|
setLanguage: (language) => dispatch(doSetLanguage(language)),
|
2019-10-01 06:53:33 +02:00
|
|
|
signIn: () => dispatch(doSignIn()),
|
2019-09-23 03:56:43 +02:00
|
|
|
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
|
2021-03-03 19:50:16 +01:00
|
|
|
syncLoop: (noInterval) => dispatch(doSyncLoop(noInterval)),
|
2020-01-14 21:44:07 +01:00
|
|
|
setReferrer: (referrer, doClaim) => dispatch(doUserSetReferrer(referrer, doClaim)),
|
2021-02-09 17:05:56 +01:00
|
|
|
setActiveChannelIfNotSet: () => dispatch(doSetActiveChannel()),
|
|
|
|
setIncognito: () => dispatch(doSetIncognito()),
|
2021-03-03 19:50:16 +01:00
|
|
|
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
|
2021-06-09 21:20:19 +02:00
|
|
|
resolveUris: (uris) => dispatch(doResolveUris(uris)),
|
2021-06-04 08:43:36 +02:00
|
|
|
fetchModAmIList: () => dispatch(doFetchCommentModAmIList()),
|
2017-06-06 06:21:55 +02:00
|
|
|
});
|
2017-04-07 07:15:22 +02:00
|
|
|
|
2020-03-12 02:43:52 +01:00
|
|
|
export default hot(connect(select, perform)(App));
|