Skip to content

Commit

Permalink
Show the commits page longer
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasDeBruijn committed May 2, 2024
1 parent 513a7a7 commit edee8c5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions sample.env
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ VITE_ACTIVITY_ENDPOINT=https://koala.svsticky.nl/api/activities
# Timers
VITE_LOAD_INTERVAL=900000 # 15 * 60 * 1000
VITE_NEXT_INTERVAL=8000 # 8 * 1000
VITE_NEXT_INTERVAL_COMMITS=

# Commits page
VITE_GITHUB_REPOS=svsticky/radio svsticky/constipated-koala svsticky/static-sticky
Expand Down
13 changes: 8 additions & 5 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import BoardText from "./components/BoardText";
import Quotes from "./components/Quotes";
import Ad from "./components/Ad";
import { TeamPage } from "./components/Team";
import {GITHUB_REPOS, LOGO} from "./helpers/env";
import {GITHUB_REPOS, LOGO, NEXT_INTERVAL, NEXT_INTERVAL_COMMITS} from "./helpers/env";
import { CommitsPage } from "./components/Commits";

export default class App extends Component {
Expand Down Expand Up @@ -80,9 +80,12 @@ export default class App extends Component {
// Temporarily disabled
break;
case "commits":
this.setState({
current: "activities",
});
setTimeout(
() => this.setState({
current: "activities",
}),
NEXT_INTERVAL_COMMITS
)
break;
default:
return;
Expand All @@ -94,7 +97,7 @@ export default class App extends Component {
// Every this.props.nextInterval, we switch to the next ad or activity to display
this.activityChanger = setInterval(
this.next.bind(this),
parseInt(import.meta.env.VITE_NEXT_INTERVAL)
parseInt(NEXT_INTERVAL)
);
}

Expand Down
3 changes: 3 additions & 0 deletions src/helpers/env.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ export const GITHUB_REPOS = import.meta.env.VITE_GITHUB_REPOS;

export const KOALA_ACTIVITY_ENDPOINT = import.meta.env.VITE_ACTIVITY_ENDPOINT;
export const LOGO = import.meta.env.VITE_LOGO;

export const NEXT_INTERVAL = import.meta.env.VITE_NEXT_INTERVAL;
export const NEXT_INTERVAL_COMMITS = import.meta.env.VITE_NEXT_INTERVAL_COMMITS;

0 comments on commit edee8c5

Please sign in to comment.