Skip to content

Commit 79277c8

Browse files
Fix TypeScript build errors after library upgrades
- Remove unused piniaSocketStore variable in main.ts - Update defineStore to use string-first parameter syntax for Pinia 3.x - Fix unused parameter warning in forEach callback 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 9653f8c commit 79277c8

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ app.config.unwrapInjectedRef = true
1919
*/
2020

2121
// Set up Pinia store before mounting
22-
const piniaSocketStore = useSocketStoreWithOut(app);
22+
useSocketStoreWithOut(app);
2323

2424
app.use(VueCookieNext);
2525

src/store/pinia/useSocketStore.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ import { setupStore } from "@/store/pinia/store";
55
import { SocketStore } from "@/store/pinia/typeOfSocketStore";
66
import { emitter } from "@/eventBus";
77

8-
export const useSocketStore = defineStore({
9-
id: "socket",
8+
export const useSocketStore = defineStore("socket", {
109
state: (): SocketStore => ({
1110
// 连接状态
1211
isConnected: false,
@@ -46,7 +45,7 @@ export const useSocketStore = defineStore({
4645
// Check if there are pending outgoing messages
4746
if (this.outgoingMessages.length > 0) {
4847
// Loop through the outgoing messages and send them
49-
this.outgoingMessages.forEach((message,index) => {
48+
this.outgoingMessages.forEach((_message, index) => {
5049
// Send the message through the WebSocket
5150
// TODO: Get app reference properly for WebSocket
5251
// app.config.globalProperties.$socket.sendObj({

0 commit comments

Comments
 (0)