Skip to content

Commit 9375f79

Browse files
committed
feat: fix issue with global ban data not refreshing, there is still an issue with temp banning
1 parent cd2eb86 commit 9375f79

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

src/components/modals/profile/ManageBans.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,6 @@
7979
Confirm
8080
</button>
8181
</div>
82-
<label v-if="errorMessage" class="red centered-text">{{errorMessage}}</label>
8382
</form>
8483
</template>
8584
</modal>
@@ -89,7 +88,7 @@
8988
import Modal from '@/components/layout/Modal.vue'
9089
import { reactive, toRefs, inject, onBeforeMount, onBeforeUpdate } from 'vue'
9190
import { cloneDeep, difference } from 'lodash'
92-
import { boardsApi, banApi } from '@/api'
91+
import { boardsApi, banApi, usersApi } from '@/api'
9392
import humanDate from '@/composables/filters/humanDate'
9493
import moment from 'moment'
9594
import IgnoredBoardsPartial from '@/components/settings/IgnoredBoardsPartial.vue'
@@ -136,6 +135,12 @@ export default {
136135
v.permanentBan = true
137136
v.userCopy.permanent_ban = true
138137
}
138+
else {
139+
v.permanentBan = null
140+
v.banUserIp = null
141+
v.banUntil = null
142+
v.userCopy.permanent_ban = false
143+
}
139144
}
140145
141146
const initBanInfo = bannedBoards => {
@@ -173,8 +178,6 @@ export default {
173178
174179
const updateBan = () => {
175180
v.errorMessage = null
176-
$alertStore.info('TODO: Update Ban')
177-
close()
178181
179182
// Used to update reports in table
180183
let results = {
@@ -266,6 +269,12 @@ export default {
266269
)
267270
}
268271
Promise.all(promises)
272+
.then(() => usersApi.find(props.user.username))
273+
.then(updatedUser => {
274+
Object.assign(v.userReactive, updatedUser)
275+
Object.assign(v.userCopy, updatedUser)
276+
props.disableBoardBans ? initGlobalBanInfo() : init()
277+
})
269278
.then(() => close())
270279
}
271280
@@ -280,7 +289,6 @@ export default {
280289
}
281290
282291
const close = () => {
283-
v.errorMessage = null
284292
emit('close')
285293
}
286294

0 commit comments

Comments
 (0)