mirror of
https://github.com/MetinSeylan/Vue-Socket.io.git
synced 2025-04-16 15:21:28 +02:00
Modified darkMode default to 'prefers-color-scheme'
This commit is contained in:
parent
cce39479ae
commit
3a9c579aa5
4 changed files with 8 additions and 7 deletions
|
@ -87,7 +87,7 @@ new Vue({
|
|||
**Parameters**|**Type's**|**Default**|**Required**|**Description**
|
||||
-----|-----|-----|-----|-----
|
||||
debug|Boolean|`false`|Optional|Enable logging for debug
|
||||
darkMode|Boolean|`false`|Optional|Enable console dark mode for debug
|
||||
darkMode|Boolean|prefers-color-scheme|Optional|Enable console dark mode for debug
|
||||
connection|String/Socket.io-client|`null`|Required|Websocket server url or socket.io-client instance
|
||||
vuex.store|Vuex|`null`|Optional|Vuex store instance
|
||||
vuex.actionPrefix|String|`null`|Optional|Prefix for emitting server side vuex actions
|
||||
|
|
8
dist/vue-socketio.js
vendored
8
dist/vue-socketio.js
vendored
File diff suppressed because one or more lines are too long
|
@ -17,7 +17,7 @@ export default class VueSocketIO {
|
|||
constructor({connection, vuex, debug, darkMode, options}){
|
||||
|
||||
Logger.debug = debug;
|
||||
Logger.darkMode = darkMode;
|
||||
Logger.darkMode = darkMode || window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
||||
this.io = this.connect(connection, options);
|
||||
this.emitter = new Emitter(vuex);
|
||||
this.listener = new Listener(this.io, this.emitter);
|
||||
|
|
|
@ -10,7 +10,6 @@ export default new class VueSocketIOLogger {
|
|||
}
|
||||
|
||||
info(text, data = '') {
|
||||
|
||||
if(this.debug) {
|
||||
if (this.darkMode) {
|
||||
window.console.info(this.prefix+`%c${text}`, 'color: #A9D341; font-weight: 600', 'color: #F7AC15', data);
|
||||
|
@ -45,4 +44,4 @@ export default new class VueSocketIOLogger {
|
|||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue