Skip to content

Commit

Permalink
fixing broken date on markdown files and api key generation and monit…
Browse files Browse the repository at this point in the history
…or subscribe undefined
  • Loading branch information
martinalong committed Apr 30, 2021
1 parent 7501aad commit 4656540
Show file tree
Hide file tree
Showing 10 changed files with 6,377 additions and 655 deletions.
2 changes: 1 addition & 1 deletion components/core/SlateMediaObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ export default class SlateMediaObject extends React.Component {
}

if (file.filename.endsWith(".md") || type.startsWith("text/plain")) {
return <MarkdownFrame date={file.data.date} url={url} />;
return <MarkdownFrame date={file.createdAt} url={url} />;
}

if (Validations.isPreviewableImage(type)) {
Expand Down
3 changes: 2 additions & 1 deletion node_common/data/methods/get-every-file.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ export default async ({ sanitize = false, publicOnly = false } = {}) => {
"files.ownerId",
"files.cid",
"files.isPublic",
"files.data"
"files.data",
"files.createdAt"
)
.from("files")
.leftJoin("slate_files", "slate_files.fileId", "files.id")
Expand Down
3 changes: 2 additions & 1 deletion node_common/data/methods/get-files-by-ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default async ({ ids, sanitize = false, publicOnly = false }) => {
"files.cid",
"files.isPublic",
"files.filename",
"files.data"
"files.data",
"files.createdAt"
)
.from("files")
.leftJoin("slate_files", "slate_files.fileId", "=", "files.id")
Expand Down
3 changes: 2 additions & 1 deletion node_common/data/methods/get-files-by-user-id.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default async ({ id, sanitize = false, publicOnly = false }) => {
"files.cid",
"files.isPublic",
"files.filename",
"files.data"
"files.data",
"files.createdAt"
)
.from("files")
.leftJoin("slate_files", "slate_files.fileId", "=", "files.id")
Expand Down
3 changes: 2 additions & 1 deletion node_common/data/methods/get-slate-files-by-cids.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export default async ({ slateId, cids }) => {
"files.cid",
"files.isPublic",
"files.filename",
"files.data"
"files.data",
"files.createdAt"
)
.from("files")
.join("slate_files", "slate_files.fileId", "=", "files.id")
Expand Down
2 changes: 1 addition & 1 deletion node_common/managers/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const websocketSend = async (type, data) => {
);

// NOTE(jim): Only allow this to be passed around encrypted.
if (ws.readyState === WebSocket.OPEN) {
if (ws && ws.readyState === WebSocket.OPEN) {
ws.send(
JSON.stringify({
type,
Expand Down
2 changes: 1 addition & 1 deletion node_common/managers/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const websocketSend = async (type, data) => {
);

// NOTE(jim): Only allow this to be passed around encrypted.
if (ws.readyState === WebSocket.OPEN) {
if (ws && ws.readyState === WebSocket.OPEN) {
ws.send(
JSON.stringify({
type,
Expand Down
2 changes: 1 addition & 1 deletion node_common/monitor.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ export const subscribeSlate = ({ user, targetSlate }) => {
const userURL = `<${userProfileURL}|${user.username}>`;

const targetSlatePageURL = `https://slate.host/$/${targetSlate.id}`;
const targetSlateURL = `<${targetSlatePageURL}|${targetSlate.slateId}>`;
const targetSlateURL = `<${targetSlatePageURL}|${targetSlate.id}>`;

const message = `*${userURL}* subscribed to collection:${targetSlateURL}`;
Social.sendSlackMessage(message);
Expand Down
1 change: 1 addition & 0 deletions node_common/serializers.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export const sanitizeFile = (entity) => {
ownerId: entity.ownerId,
isPublic: entity.isPublic,
filename: entity.filename,
createdAt: entity.createdAt,
data: {
type: entity.data?.type,
name: entity.data?.name,
Expand Down
Loading

0 comments on commit 4656540

Please sign in to comment.