mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
Merge pull request #80 from ragestudio/low-latency-streaming
other-fixes
This commit is contained in:
commit
25660c4370
22
.vscode/settings.json
vendored
22
.vscode/settings.json
vendored
@ -1,3 +1,23 @@
|
|||||||
{
|
{
|
||||||
"discord.enabled": false
|
"discord.enabled": false,
|
||||||
|
"workbench.colorCustomizations": {
|
||||||
|
"activityBar.activeBackground": "#65c89b",
|
||||||
|
"activityBar.background": "#65c89b",
|
||||||
|
"activityBar.foreground": "#15202b",
|
||||||
|
"activityBar.inactiveForeground": "#15202b99",
|
||||||
|
"activityBarBadge.background": "#945bc4",
|
||||||
|
"activityBarBadge.foreground": "#e7e7e7",
|
||||||
|
"commandCenter.border": "#15202b99",
|
||||||
|
"sash.hoverBorder": "#65c89b",
|
||||||
|
"statusBar.background": "#42b883",
|
||||||
|
"statusBar.foreground": "#15202b",
|
||||||
|
"statusBarItem.hoverBackground": "#359268",
|
||||||
|
"statusBarItem.remoteBackground": "#42b883",
|
||||||
|
"statusBarItem.remoteForeground": "#15202b",
|
||||||
|
"titleBar.activeBackground": "#42b883",
|
||||||
|
"titleBar.activeForeground": "#15202b",
|
||||||
|
"titleBar.inactiveBackground": "#42b88399",
|
||||||
|
"titleBar.inactiveForeground": "#15202b99"
|
||||||
|
},
|
||||||
|
"peacock.remoteColor": "#42b883"
|
||||||
}
|
}
|
@ -22,5 +22,5 @@
|
|||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"concurrently": "^7.5.0"
|
"concurrently": "^7.5.0"
|
||||||
},
|
},
|
||||||
"version": "0.28.3"
|
"version": "0.28.4"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "comty",
|
"name": "comty",
|
||||||
"version": "0.28.3",
|
"version": "0.28.4",
|
||||||
"license": "LGPL-2.1",
|
"license": "LGPL-2.1",
|
||||||
"main": "electron/main",
|
"main": "electron/main",
|
||||||
"author": "RageStudio",
|
"author": "RageStudio",
|
||||||
|
@ -69,9 +69,15 @@
|
|||||||
|
|
||||||
.ant-upload {
|
.ant-upload {
|
||||||
span {
|
span {
|
||||||
width: fit-content !important;
|
width: 100%;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
svg {
|
||||||
|
margin: 0 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.ant-upload-select-picture-card {
|
.ant-upload-select-picture-card {
|
||||||
background-color: transparent !important;
|
background-color: transparent !important;
|
||||||
}
|
}
|
||||||
@ -112,7 +118,7 @@
|
|||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
|
|
||||||
|
@ -75,6 +75,26 @@ export default class User {
|
|||||||
return User.hasRole("admin")
|
return User.hasRole("admin")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static async getUserBadges(user_id) {
|
||||||
|
if (!User.bridge) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!user_id) {
|
||||||
|
user_id = await User.selfUserId()
|
||||||
|
}
|
||||||
|
|
||||||
|
const { data } = await app.api.customRequest("main", {
|
||||||
|
method: "GET",
|
||||||
|
url: "/user/badges",
|
||||||
|
params: {
|
||||||
|
user_id: user_id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
return data
|
||||||
|
}
|
||||||
|
|
||||||
static async register(payload) {
|
static async register(payload) {
|
||||||
if (!User.bridge) {
|
if (!User.bridge) {
|
||||||
return false
|
return false
|
||||||
|
@ -49,16 +49,17 @@ const TabRender = React.memo((props) => {
|
|||||||
const UserBadges = React.memo((props) => {
|
const UserBadges = React.memo((props) => {
|
||||||
return React.createElement(Loadable({
|
return React.createElement(Loadable({
|
||||||
loader: async () => {
|
loader: async () => {
|
||||||
let { badges } = props
|
let { user_id } = props
|
||||||
|
|
||||||
|
const badgesData = await User.getUserBadges(user_id).catch((err) => {
|
||||||
|
console.error(err)
|
||||||
|
|
||||||
|
app.message.error("Failed to fetch user badges")
|
||||||
|
|
||||||
if (!badges || Array.isArray(badges) === false || badges.length === 0) {
|
|
||||||
return null
|
return null
|
||||||
}
|
})
|
||||||
|
|
||||||
// fetch badges datam from api
|
console.log(badgesData)
|
||||||
const badgesData = await app.api.request("main", "get", "badges", {
|
|
||||||
_id: badges
|
|
||||||
}).catch(() => false)
|
|
||||||
|
|
||||||
if (!badgesData) {
|
if (!badgesData) {
|
||||||
return null
|
return null
|
||||||
@ -286,7 +287,7 @@ export default class Account extends React.Component {
|
|||||||
|
|
||||||
<div className="badgesTab">
|
<div className="badgesTab">
|
||||||
<React.Suspense fallback={<antd.Skeleton />}>
|
<React.Suspense fallback={<antd.Skeleton />}>
|
||||||
<UserBadges badges={user.badges} />
|
<UserBadges user_id={user._id} />
|
||||||
</React.Suspense>
|
</React.Suspense>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@comty/server",
|
"name": "@comty/server",
|
||||||
"version": "0.28.3",
|
"version": "0.28.4",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "corenode-cli build",
|
"build": "corenode-cli build",
|
||||||
|
@ -28,6 +28,22 @@ export default class BadgesController extends Controller {
|
|||||||
return res.json(badges)
|
return res.json(badges)
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
"/user/badges": {
|
||||||
|
middlewares: ["withAuthentication"],
|
||||||
|
fn: async (req, res) => {
|
||||||
|
const user = await User.findOne({ _id: req.query.user_id ?? req.user._id })
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
return res.status(404).json({ error: "User not found" })
|
||||||
|
}
|
||||||
|
|
||||||
|
const badges = await Badge.find({
|
||||||
|
name: { $in: user.badges },
|
||||||
|
})
|
||||||
|
|
||||||
|
return res.json(badges)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
post = {
|
post = {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "wrapper",
|
"name": "wrapper",
|
||||||
"version": "0.28.3",
|
"version": "0.28.4",
|
||||||
"main": "./src/index.js",
|
"main": "./src/index.js",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user