2323<template >
2424 <div class =" text-editor__session-list" >
2525 <div v-tooltip =" lastSavedStatusTooltip" class =" save-status" :class =" saveStatusClass" >
26- <SavingIndicator :saving =" saveStatusClass === 'saving'"
27- :error =" saveStatusClass === 'error'" />
26+ <NcButton type =" tertiary"
27+ @click =" onClickSave" >
28+ <template #icon >
29+ <SavingIndicator :saving =" saveStatusClass === 'saving'"
30+ :error =" saveStatusClass === 'error'" />
31+ </template >
32+ </NcButton >
2833 </div >
2934 <SessionList :sessions =" sessions" >
3035 <p slot =" lastSaved" class =" last-saved" >
3843<script >
3944
4045import SavingIndicator from ' ../SavingIndicator.vue'
41- import { ERROR_TYPE } from ' ./. ./../services/SyncService.js'
46+ import { ERROR_TYPE } from ' ../../services/SyncService.js'
4247import moment from ' @nextcloud/moment'
43- import { Tooltip } from ' @nextcloud/vue'
48+ import { NcButton , Tooltip } from ' @nextcloud/vue'
4449import {
4550 useIsMobileMixin ,
4651 useIsPublicMixin ,
52+ useSyncServiceMixin ,
4753} from ' ../Editor.provider.js'
4854import refreshMoment from ' ../../mixins/refreshMoment.js'
4955
5056export default {
5157 name: ' Status' ,
5258
5359 components: {
60+ NcButton,
5461 SavingIndicator,
5562 SessionList : () => import (/* webpackChunkName: "editor-collab" */ ' ./SessionList.vue' ),
5663 GuestNameDialog : () => import (/* webpackChunkName: "editor-guest" */ ' ./GuestNameDialog.vue' ),
@@ -60,7 +67,12 @@ export default {
6067 Tooltip,
6168 },
6269
63- mixins: [useIsMobileMixin, useIsPublicMixin, refreshMoment],
70+ mixins: [
71+ useIsMobileMixin,
72+ useIsPublicMixin,
73+ useSyncServiceMixin,
74+ refreshMoment,
75+ ],
6476
6577 props: {
6678 hasConnectionIssue: {
@@ -124,13 +136,20 @@ export default {
124136 return Object .values (this .sessions ).find ((session ) => session .isCurrent )
125137 },
126138 lastSavedString () {
127- // Make this a dependent of refreshMoment so it will be recomputed
139+ // Make this a dependent of refreshMoment, so it will be recomputed
128140 /* eslint-disable-next-line no-unused-expressions */
129141 this .refreshMoment
130142 return moment (this .document .lastSavedVersionTime * 1000 ).fromNow ()
131143 },
132144 },
133145
146+ methods: {
147+ onClickSave () {
148+ if (this .dirtyStateIndicator ) {
149+ this .$syncService .forceSave ()
150+ }
151+ },
152+ },
134153}
135154 </script >
136155
0 commit comments