Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F85806887
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
12 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/App.js b/src/App.js
index f1a4e2b6f3..13bd3e05a3 100644
--- a/src/App.js
+++ b/src/App.js
@@ -1,106 +1,107 @@
import UserPanel from './components/user_panel/user_panel.vue'
import NavPanel from './components/nav_panel/nav_panel.vue'
import Notifications from './components/notifications/notifications_two.vue'
import UserFinder from './components/user_finder/user_finder.vue'
import InstanceSpecificPanel from './components/instance_specific_panel/instance_specific_panel.vue'
import FeaturesPanel from './components/features_panel/features_panel.vue'
import WhoToFollowPanel from './components/who_to_follow_panel/who_to_follow_panel.vue'
import ChatPanel from './components/chat_panel/chat_panel.vue'
import MediaModal from './components/media_modal/media_modal.vue'
import SideDrawer from './components/side_drawer/side_drawer.vue'
import { unseenNotificationsFromStore } from './services/notification_utils/notification_utils'
export default {
name: 'app',
components: {
UserPanel,
NavPanel,
Notifications,
UserFinder,
InstanceSpecificPanel,
FeaturesPanel,
WhoToFollowPanel,
ChatPanel,
MediaModal,
SideDrawer
},
data: () => ({
mobileActivePanel: 'timeline',
finderHidden: true,
supportsMask: window.CSS && window.CSS.supports && (
window.CSS.supports('mask-size', 'contain') ||
window.CSS.supports('-webkit-mask-size', 'contain') ||
window.CSS.supports('-moz-mask-size', 'contain') ||
window.CSS.supports('-ms-mask-size', 'contain') ||
window.CSS.supports('-o-mask-size', 'contain')
)
}),
created () {
// Load the locale from the storage
this.$i18n.locale = this.$store.state.config.interfaceLanguage
},
computed: {
currentUser () { return this.$store.state.usersTwo.currentUser },
background () {
return this.currentUser.background_image || this.$store.state.instance.background
},
enableMask () { return this.supportsMask && this.$store.state.instance.logoMask },
logoStyle () {
return {
'visibility': this.enableMask ? 'hidden' : 'visible'
}
},
logoMaskStyle () {
return this.enableMask ? {
'mask-image': `url(${this.$store.state.instance.logo})`
} : {
'background-color': this.enableMask ? '' : 'transparent'
}
},
logoBgStyle () {
return Object.assign({
'margin': `${this.$store.state.instance.logoMargin} 0`,
opacity: this.finderHidden ? 1 : 0
}, this.enableMask ? {} : {
'background-color': this.enableMask ? '' : 'transparent'
})
},
logo () { return this.$store.state.instance.logo },
bgStyle () {
return {
'background-image': `url(${this.background})`
}
},
bgAppStyle () {
return {
'--body-background-image': `url(${this.background})`
}
},
sitename () { return this.$store.state.instance.name },
chat () { return this.$store.state.chat.channel.state === 'joined' },
suggestionsEnabled () { return this.$store.state.instance.suggestionsEnabled },
showInstanceSpecificPanel () { return this.$store.state.instance.showInstanceSpecificPanel },
unseenNotifications () {
- return unseenNotificationsFromStore(this.$store)
+ // TODO: Fix
+ return []
},
unseenNotificationsCount () {
return this.unseenNotifications.length
},
showFeaturesPanel () { return this.$store.state.instance.showFeaturesPanel }
},
methods: {
scrollToTop () {
window.scrollTo(0, 0)
},
logout () {
this.$router.replace('/main/public')
this.$store.dispatch('logoutUser')
},
onFinderToggled (hidden) {
this.finderHidden = hidden
},
toggleMobileSidebar () {
this.$refs.sideDrawer.toggleDrawer()
}
}
}
diff --git a/src/components/notifications/notifications_two.js b/src/components/notifications/notifications_two.js
index 223c052fea..c802ffbcd2 100644
--- a/src/components/notifications/notifications_two.js
+++ b/src/components/notifications/notifications_two.js
@@ -1,72 +1,63 @@
import Notification from '../notification/notification_two.vue'
import notificationsFetcher from '../../services/notifications_fetcher/notifications_fetcher.service.js'
import {
unseenNotificationsFromStore
} from '../../services/notification_utils/notification_utils.js'
import { map } from 'lodash'
const Notifications = {
created () {
this.$store.dispatch('startFetchingNotifications')
},
data () {
return {
bottomedOut: false
}
},
computed: {
error () {
- return this.$store.state.statuses.notifications.error
+ // TODO: fix
+ return false
},
unseenNotifications () {
- return unseenNotificationsFromStore(this.$store)
+ // TODO: fix
+ return []
},
visibleNotifications () {
const notifications = map(this.$store.state.notifications.visibleNotificationIds, (id) => {
return this.$store.state.notifications.notifications[id]
})
return notifications
},
unseenCount () {
return this.unseenNotifications.length
},
loading () {
- return this.$store.state.statuses.notifications.loading
+ // TODO: Fix
+ return false
}
},
components: {
Notification
},
watch: {
unseenCount (count) {
if (count > 0) {
this.$store.dispatch('setPageTitle', `(${count})`)
} else {
this.$store.dispatch('setPageTitle', '')
}
}
},
methods: {
markAsSeen () {
this.$store.dispatch('markNotificationsAsSeen', this.visibleNotifications)
},
fetchOlderNotifications () {
- const store = this.$store
- const credentials = store.state.users.currentUser.credentials
- store.commit('setNotificationsLoading', { value: true })
- notificationsFetcher.fetchAndUpdate({
- store,
- credentials,
- older: true
- }).then(notifs => {
- store.commit('setNotificationsLoading', { value: false })
- if (notifs.length === 0) {
- this.bottomedOut = true
- }
- })
+ // TODO: Repair
}
}
}
export default Notifications
diff --git a/src/components/timeline/timeline_two.js b/src/components/timeline/timeline_two.js
index 722595bbcc..263927a967 100644
--- a/src/components/timeline/timeline_two.js
+++ b/src/components/timeline/timeline_two.js
@@ -1,111 +1,114 @@
import StatusOrConversation from '../status_or_conversation/status_or_conversation_two.vue'
import { throttle, map } from 'lodash'
const Timeline = {
props: [
'timeline',
'timelineName',
'title',
'userId',
'tag',
'embedded',
'count'
],
data () {
return {
paused: false,
unfocused: false,
bottomedOut: false
}
},
computed: {
visibleStatuses () {
return map(this.timeline.visibleStatusIds, (id) => this.statuses[id])
},
statuses () {
return this.$store.state.statusesTwo.statuses
},
- timelineError () { return this.$store.state.statuses.error },
+ timelineError () {
+ // TODO: fix
+ return false
+ },
newStatusCount () {
if (!this.timeline) { return 0 }
return this.timeline.newStatusCount
},
newStatusCountStr () {
return ` (${this.newStatusCount})`
},
classes () {
return {
root: ['timeline'].concat(!this.embedded ? ['panel', 'panel-default'] : []),
header: ['timeline-heading'].concat(!this.embedded ? ['panel-heading'] : []),
body: ['timeline-body'].concat(!this.embedded ? ['panel-body'] : []),
footer: ['timeline-footer'].concat(!this.embedded ? ['panel-footer'] : [])
}
}
},
components: {
StatusOrConversation
},
created () {
window.addEventListener('scroll', this.scrollLoad)
},
mounted () {
if (typeof document.hidden !== 'undefined') {
document.addEventListener('visibilitychange', this.handleVisibilityChange, false)
this.unfocused = document.hidden
}
window.addEventListener('keydown', this.handleShortKey)
},
destroyed () {
window.removeEventListener('scroll', this.scrollLoad)
window.removeEventListener('keydown', this.handleShortKey)
if (typeof document.hidden !== 'undefined') document.removeEventListener('visibilitychange', this.handleVisibilityChange, false)
// this.$store.commit('setLoading', { timeline: this.timelineName, value: false })
},
methods: {
handleShortKey (e) {
if (e.key === '.') this.showNewStatuses()
},
showNewStatuses () {
if (this.newStatusCount === 0) return
this.$store.dispatch('showNewStatusesForTimeline', { timelineName: this.timelineName })
this.paused = false
},
fetchOlderStatuses: throttle(function () {
this.$store.dispatch('fetchNextForTimeline', { timelineName: this.timelineName })
}, 1000, this),
scrollLoad (e) {
const bodyBRect = document.body.getBoundingClientRect()
const height = Math.max(bodyBRect.height, -(bodyBRect.y))
if (this.timeline.loading === false &&
this.$store.state.config.autoLoad &&
this.$el.offsetHeight > 0 &&
(window.innerHeight + window.pageYOffset) >= (height - 750)) {
this.fetchOlderStatuses()
}
},
handleVisibilityChange () {
this.unfocused = document.hidden
}
},
watch: {
newStatusCount (count) {
if (!this.$store.state.config.streaming) {
return
}
if (count > 0) {
// only 'stream' them when you're scrolled to the top
if (window.pageYOffset < 15 &&
!this.paused &&
!(this.unfocused && this.$store.state.config.pauseOnUnfocused)
) {
this.showNewStatuses()
} else {
this.paused = true
}
}
}
}
}
export default Timeline
diff --git a/src/main.js b/src/main.js
index 8ef067f0f8..329b8683a3 100644
--- a/src/main.js
+++ b/src/main.js
@@ -1,92 +1,92 @@
import Vue from 'vue'
import VueRouter from 'vue-router'
import Vuex from 'vuex'
import interfaceModule from './modules/interface.js'
import instanceModule from './modules/instance.js'
-import statusesModule from './modules/statuses.js'
+// import statusesModule from './modules/statuses.js'
import statusesTwoModule from './modules/statuses_two.js'
import notificationsModule from './modules/notifications.js'
// import usersModule from './modules/users.js'
import usersTwoModule from './modules/users_two.js'
// import apiModule from './modules/api.js'
import apiTwoModule from './modules/api_two.js'
import configModule from './modules/config.js'
import chatModule from './modules/chat.js'
import oauthModule from './modules/oauth.js'
import mediaViewerModule from './modules/media_viewer.js'
import oauthTokensModule from './modules/oauth_tokens.js'
import VueTimeago from 'vue-timeago'
import VueI18n from 'vue-i18n'
import createPersistedState from './lib/persisted_state.js'
import pushNotifications from './lib/push_notifications_plugin.js'
import messages from './i18n/messages.js'
import VueChatScroll from 'vue-chat-scroll'
import afterStoreSetup from './boot/after_store.js'
const currentLocale = (window.navigator.language || 'en').split('-')[0]
Vue.use(Vuex)
Vue.use(VueRouter)
Vue.use(VueTimeago, {
locale: currentLocale === 'ja' ? 'ja' : 'en',
locales: {
'en': require('../static/timeago-en.json'),
'ja': require('../static/timeago-ja.json')
}
})
Vue.use(VueI18n)
Vue.use(VueChatScroll)
const i18n = new VueI18n({
// By default, use the browser locale, we will update it if neccessary
locale: currentLocale,
fallbackLocale: 'en',
messages
})
const persistedStateOptions = {
paths: [
'config',
'users.lastLoginName',
'oauth'
]
};
(async function () {
const persistedState = await createPersistedState(persistedStateOptions)
const store = new Vuex.Store({
modules: {
interface: interfaceModule,
instance: instanceModule,
- statuses: statusesModule,
+ // statuses: statusesModule,
statusesTwo: statusesTwoModule,
notifications: notificationsModule,
// users: usersModule,
usersTwo: usersTwoModule,
// api: apiModule,
apiTwo: apiTwoModule,
config: configModule,
chat: chatModule,
oauth: oauthModule,
mediaViewer: mediaViewerModule,
oauthTokens: oauthTokensModule
},
plugins: [persistedState, pushNotifications],
strict: false // Socket modifies itself, let's ignore this for now.
// strict: process.env.NODE_ENV !== 'production'
})
afterStoreSetup({ store, i18n })
})()
// These are inlined by webpack's DefinePlugin
/* eslint-disable */
window.___pleromafe_mode = process.env
window.___pleromafe_commit_hash = COMMIT_HASH
window.___pleromafe_dev_overrides = DEV_OVERRIDES
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Oct 13, 1:20 PM (1 d, 20 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1786788
Default Alt Text
(12 KB)
Attached To
Mode
rPUFE pleroma-fe-upstream
Attached
Detach File
Event Timeline
Log In to Comment