fix: check only not empty filename for metadata in farm printers (#1392)
This commit is contained in:
1 parent
630d67efc5
commit
f9556e27b3
3 files changed
+5
-4
No files matched your search
+3
-2
@@ -194,8 +194,9 @@ export default class App extends Mixins(BaseMixin) {
|
||||
|
||||
@Watch('current_file')
|
||||
current_fileChanged(newVal: string): void {
|
||||
if (newVal !== '')
|
||||
this.$socket.emit('server.files.metadata', { filename: newVal }, { action: 'files/getMetadataCurrentFile' })
|
||||
if (newVal === '') return
|
||||
|
||||
this.$socket.emit('server.files.metadata', { filename: newVal }, { action: 'files/getMetadataCurrentFile' })
|
||||
}
|
||||
|
||||
@Watch('primaryColor')
|
||||
|
||||
@@ -190,7 +190,7 @@ export const actions: ActionTree<FarmPrinterState, RootState> = {
|
||||
const data = 'status' in payload ? { ...payload.status } : { ...payload }
|
||||
commit('setData', data)
|
||||
|
||||
if ('print_stats' in data && 'filename' in data.print_stats) {
|
||||
if ((data.print_stats?.filename ?? '') !== '') {
|
||||
dispatch('sendObj', {
|
||||
method: 'server.files.metadata',
|
||||
params: { filename: data.print_stats?.filename },
|
||||
|
||||
@@ -91,7 +91,7 @@ export const mutations: MutationTree<FileState> = {
|
||||
parent[indexFile].metadataRequested = false
|
||||
parent[indexFile].metadataPulled = false
|
||||
|
||||
const extension = filename.substr(filename.lastIndexOf('.') + 1)
|
||||
const extension = filename.substring(filename.lastIndexOf('.') + 1)
|
||||
if (payload.item.root === 'gcodes' && extension === 'gcode') {
|
||||
Vue.$socket.emit(
|
||||
'server.files.metadata',
|
||||
|
||||
Reference in new issue
Block a user